-
Notifications
You must be signed in to change notification settings - Fork 17
/
main.go
44 lines (36 loc) · 1.01 KB
/
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
44
package main
import (
"log"
"github.com/chamanbravo/upstat/database"
_ "github.com/chamanbravo/upstat/docs"
"github.com/chamanbravo/upstat/utils"
"github.com/chamanbravo/upstat/routes"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/logger"
_ "github.com/joho/godotenv/autoload"
)
// @title Upstat API
// @version 1.0
// @description This is an auto-generated API Docs for Upstat API.
// @contact.email [email protected]
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
// @BasePath /api
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name Authorization
func main() {
app := fiber.New()
app.Use(logger.New())
if err := database.DBConnect(); err != nil {
log.Fatal("Could not connect to database", err)
}
utils.StartGoroutineSetup()
routes.AuthRoutes(app)
routes.SwaggerRoute(app)
routes.MonitorRoutes(app)
routes.UserRoutes(app)
routes.NotificationRoutes(app)
routes.StatusPagesRoutes(app)
log.Fatal(app.Listen(":8000"))
}