From 3a1ac8161a199ea70e84c4a3b28a71044a8b7889 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Sat, 22 Oct 2022 19:24:57 +0300 Subject: serve static files generated from vue --- main.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index f1490f9..d62ba62 100644 --- a/main.go +++ b/main.go @@ -1,8 +1,10 @@ package main import ( + "github.com/gin-gonic/contrib/static" "github.com/gin-gonic/gin" "github.com/pektezol/leastportals/backend/controllers" + "github.com/pektezol/leastportals/backend/routes" ) func main() { @@ -10,5 +12,7 @@ func main() { gin.SetMode(gin.ReleaseMode) } router := gin.Default() + router.Use(static.Serve("/", static.LocalFile("./frontend/dist", true))) + routes.InitRoutes(router) router.Run(":4000") } -- cgit v1.2.3