chore: init Vue
This commit is contained in:
+9
-4
@@ -10,12 +10,17 @@ import (
|
||||
)
|
||||
|
||||
func KickoffApi(env runtime.Environment, db *gorm.DB) {
|
||||
router := gin.Default()
|
||||
router.LoadHTMLFiles("./web/templates/index.html")
|
||||
r := gin.Default()
|
||||
|
||||
spawnRoutes(router, env, db)
|
||||
api := r.Group("/api")
|
||||
spawnRoutes(api, env, db)
|
||||
|
||||
err := router.Run(fmt.Sprintf("%s:%s", env.Hostname, env.Port))
|
||||
r.Static("/assets", "./web/frontend/dist/assets")
|
||||
r.NoRoute(func(c *gin.Context) {
|
||||
c.File("./web/frontend/dist/index.html")
|
||||
})
|
||||
|
||||
err := r.Run(fmt.Sprintf("%s:%s", env.Hostname, env.Port))
|
||||
if err != nil {
|
||||
slog.Error("failed to start the Gin server due to: " + err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user