From 54c68dfe2f070a849e3ac87f096d588068e8a6ae Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Thu, 20 Apr 2023 22:40:33 +0300 Subject: fix: frontend serving --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 2fcf453..aae2a18 100644 --- a/main.go +++ b/main.go @@ -5,7 +5,6 @@ import ( "log" "os" - "github.com/gin-gonic/contrib/static" "github.com/gin-gonic/gin" "github.com/joho/godotenv" "github.com/pektezol/leastportals/backend/database" @@ -20,8 +19,8 @@ import ( // @license.name GNU General Public License, Version 2 // @license.url https://www.gnu.org/licenses/old-licenses/gpl-2.0.html -// @host lp.ardapektezol.com/api -// @BasePath /v1 +// @host lp.ardapektezol.com/api +// @BasePath /v1 func main() { if os.Getenv("ENV") == "PROD" { gin.SetMode(gin.ReleaseMode) @@ -32,7 +31,8 @@ func main() { } router := gin.Default() database.ConnectDB() - router.Use(static.Serve("/", static.LocalFile("./frontend/dist", true))) + // For frontend static serving - only for local debug + // router.Use(static.Serve("/", static.LocalFile("./frontend/dist", true))) routes.InitRoutes(router) router.Run(fmt.Sprintf(":%s", os.Getenv("PORT"))) } -- cgit v1.2.3