diff options
| -rw-r--r-- | go.mod | 1 | ||||
| -rw-r--r-- | go.sum | 2 | ||||
| -rw-r--r-- | main.go | 2 |
3 files changed, 5 insertions, 0 deletions
| @@ -21,6 +21,7 @@ require ( | |||
| 21 | github.com/gorilla/sessions v1.2.1 // indirect | 21 | github.com/gorilla/sessions v1.2.1 // indirect |
| 22 | github.com/json-iterator/go v1.1.12 // indirect | 22 | github.com/json-iterator/go v1.1.12 // indirect |
| 23 | github.com/leodido/go-urn v1.2.1 // indirect | 23 | github.com/leodido/go-urn v1.2.1 // indirect |
| 24 | github.com/lib/pq v1.10.7 | ||
| 24 | github.com/mattn/go-isatty v0.0.14 // indirect | 25 | github.com/mattn/go-isatty v0.0.14 // indirect |
| 25 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect | 26 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect |
| 26 | github.com/modern-go/reflect2 v1.0.2 // indirect | 27 | github.com/modern-go/reflect2 v1.0.2 // indirect |
| @@ -44,6 +44,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= | |||
| 44 | github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= | 44 | github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= |
| 45 | github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= | 45 | github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= |
| 46 | github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= | 46 | github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= |
| 47 | github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= | ||
| 48 | github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= | ||
| 47 | github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= | 49 | github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= |
| 48 | github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= | 50 | github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= |
| 49 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= | 51 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= |
| @@ -4,6 +4,7 @@ import ( | |||
| 4 | "github.com/gin-gonic/contrib/static" | 4 | "github.com/gin-gonic/contrib/static" |
| 5 | "github.com/gin-gonic/gin" | 5 | "github.com/gin-gonic/gin" |
| 6 | "github.com/pektezol/leastportals/backend/controllers" | 6 | "github.com/pektezol/leastportals/backend/controllers" |
| 7 | "github.com/pektezol/leastportals/backend/database" | ||
| 7 | "github.com/pektezol/leastportals/backend/routes" | 8 | "github.com/pektezol/leastportals/backend/routes" |
| 8 | ) | 9 | ) |
| 9 | 10 | ||
| @@ -12,6 +13,7 @@ func main() { | |||
| 12 | gin.SetMode(gin.ReleaseMode) | 13 | gin.SetMode(gin.ReleaseMode) |
| 13 | } | 14 | } |
| 14 | router := gin.Default() | 15 | router := gin.Default() |
| 16 | database.ConnectDB() | ||
| 15 | router.Use(static.Serve("/", static.LocalFile("./frontend/dist", true))) | 17 | router.Use(static.Serve("/", static.LocalFile("./frontend/dist", true))) |
| 16 | routes.InitRoutes(router) | 18 | routes.InitRoutes(router) |
| 17 | router.Run(":4000") | 19 | router.Run(":4000") |