-
Notifications
You must be signed in to change notification settings - Fork 19
/
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 chamanpro9@gmail.com
// @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"))
}