FreePad/main.go

31 lines
468 B
Go
Raw Normal View History

2022-05-18 22:54:07 +03:00
package main
import (
"os"
2022-05-19 00:40:34 +03:00
"github.com/JustKato/FreePad/lib/routes"
2022-05-18 22:54:07 +03:00
"github.com/gin-gonic/gin"
)
func main() {
_, isDevelopment := os.LookupEnv("DEV_MODE")
if isDevelopment {
gin.SetMode(gin.ReleaseMode)
}
// Initialize the router
router := gin.Default()
2022-05-19 00:31:13 +03:00
// Read HTML Templates
router.LoadHTMLGlob("templates/**/*.html")
// Load in static path
router.Static("/static", "static/")
2022-05-19 00:40:34 +03:00
// Add Routes
routes.HomeRoutes(router)
2022-05-18 22:54:07 +03:00
router.Run(":8080")
}