-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
43 lines (31 loc) · 834 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
"fmt"
//swaggerfiles "github.com/swaggo/files"
"web-app/database"
"web-app/features"
"web-app/shared"
"web-app/shared/config"
"web-app/shared/logger"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/recover"
)
func main() {
config.Init()
logger.Init()
appLogger := logger.Create("App")
if parseArguments() {
return
}
appLogger.Info("Connecting to database...")
database.Open(config.GetDbConnectionString())
appLogger.Info("Connected")
app := fiber.New()
app.Use(recover.New())
features.ConfigureRoutes(app)
address := fmt.Sprintf(":%d", config.GetAppPort())
appLogger.Info("Listening on %v...", address)
//docs.SwaggerInfo.BasePath = "/"
//app.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler))
shared.PanicOnErr(app.Listen(address))
}