53 lines
968 B
Go
53 lines
968 B
Go
// Package classification Click 'n' Join ManagementSystem Documentation
|
||
//
|
||
// Schemes: http
|
||
// Host: localhost
|
||
// BasePath: /v1
|
||
// Version: 0.0.1
|
||
//
|
||
// Consumes:
|
||
// - application/json
|
||
//
|
||
// Produces:
|
||
// - application/json
|
||
//
|
||
// swagger:meta
|
||
package main
|
||
|
||
import (
|
||
"clickandjoin.app/managementsystem/modules/config"
|
||
"clickandjoin.app/managementsystem/modules/scylladb"
|
||
"clickandjoin.app/managementsystem/routers/router"
|
||
"github.com/gofiber/fiber/v2"
|
||
"github.com/gofiber/fiber/v2/middleware/logger"
|
||
"github.com/sirupsen/logrus"
|
||
)
|
||
|
||
func init() {
|
||
config.LoadConfig()
|
||
|
||
if config.Cfg.Debug {
|
||
logrus.SetLevel(logrus.DebugLevel)
|
||
}
|
||
|
||
logrus.Println("Debug:", config.Cfg.Debug)
|
||
|
||
scylladb.InitDatabase()
|
||
}
|
||
|
||
func main() {
|
||
app := fiber.New()
|
||
|
||
cfg := config.Cfg
|
||
|
||
if cfg.Debug {
|
||
app.Use(logger.New(logger.Config{
|
||
Format: "${pid} ${locals:requestid} ${status} - ${method} ${path}\n",
|
||
}))
|
||
}
|
||
|
||
router.SetupRoutes(app)
|
||
|
||
app.Listen(cfg.Host + ":" + cfg.Port)
|
||
}
|