From 03dfacc3dfa76f2db239e4334cd4e092fc85070d Mon Sep 17 00:00:00 2001 From: Damillora Date: Wed, 30 Aug 2023 21:23:08 +0700 Subject: [PATCH] fix: default route --- pkg/app/app.go | 2 +- pkg/app/frontend_routes.go | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/app/app.go b/pkg/app/app.go index 4b7ba6f..d5bb66e 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -52,7 +52,7 @@ func Start() { g.StaticFile("/", "./web/static/index.html") g.Static("/_app", "./web/static/_app") g.Static("/data", config.CurrentConfig.DataDirectory) - + g.Use(cors.Default()) InitializeRoutes(g) diff --git a/pkg/app/frontend_routes.go b/pkg/app/frontend_routes.go index ab40a42..4672f9b 100644 --- a/pkg/app/frontend_routes.go +++ b/pkg/app/frontend_routes.go @@ -1,8 +1,6 @@ package app import ( - "net/http" - "github.com/gin-gonic/gin" ) @@ -11,5 +9,5 @@ func InitializeFrontendRoutes(g *gin.Engine) { } func frontendHome(c *gin.Context) { - c.Redirect(http.StatusFound, "/") + c.File("./web/static/index.html") }