1
0
mirror of https://github.com/JustKato/FreePad.git synced 2026-03-25 13:29:44 +02:00
Files
FreePad/main.go
2022-05-19 00:40:34 +03:00

31 lines
468 B
Go

package main
import (
"os"
"github.com/JustKato/FreePad/lib/routes"
"github.com/gin-gonic/gin"
)
func main() {
_, isDevelopment := os.LookupEnv("DEV_MODE")
if isDevelopment {
gin.SetMode(gin.ReleaseMode)
}
// Initialize the router
router := gin.Default()
// Read HTML Templates
router.LoadHTMLGlob("templates/**/*.html")
// Load in static path
router.Static("/static", "static/")
// Add Routes
routes.HomeRoutes(router)
router.Run(":8080")
}