diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2022-10-22 19:24:57 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2022-10-22 19:24:57 +0300 |
| commit | 3a1ac8161a199ea70e84c4a3b28a71044a8b7889 (patch) | |
| tree | 692843dbc2094a27bd62da075da17e0d4874bcd8 /main.go | |
| parent | example .env file (diff) | |
| download | lphub-3a1ac8161a199ea70e84c4a3b28a71044a8b7889.tar.gz lphub-3a1ac8161a199ea70e84c4a3b28a71044a8b7889.tar.bz2 lphub-3a1ac8161a199ea70e84c4a3b28a71044a8b7889.zip | |
serve static files generated from vue
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 4 |
1 files changed, 4 insertions, 0 deletions
| @@ -1,8 +1,10 @@ | |||
| 1 | package main | 1 | package main |
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "github.com/gin-gonic/contrib/static" | ||
| 4 | "github.com/gin-gonic/gin" | 5 | "github.com/gin-gonic/gin" |
| 5 | "github.com/pektezol/leastportals/backend/controllers" | 6 | "github.com/pektezol/leastportals/backend/controllers" |
| 7 | "github.com/pektezol/leastportals/backend/routes" | ||
| 6 | ) | 8 | ) |
| 7 | 9 | ||
| 8 | func main() { | 10 | func main() { |
| @@ -10,5 +12,7 @@ func main() { | |||
| 10 | gin.SetMode(gin.ReleaseMode) | 12 | gin.SetMode(gin.ReleaseMode) |
| 11 | } | 13 | } |
| 12 | router := gin.Default() | 14 | router := gin.Default() |
| 15 | router.Use(static.Serve("/", static.LocalFile("./frontend/dist", true))) | ||
| 16 | routes.InitRoutes(router) | ||
| 13 | router.Run(":4000") | 17 | router.Run(":4000") |
| 14 | } | 18 | } |