56 lines
1.1 KiB
Go
56 lines
1.1 KiB
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/rabbitmq"
|
||
"clickandjoin.app/managementsystem/modules/scylladb"
|
||
"clickandjoin.app/managementsystem/routers/router"
|
||
gocnjhelper "git.clickandjoin.umbach.dev/ClickandJoin/go-cnj-helper"
|
||
"github.com/gofiber/fiber/v2"
|
||
"github.com/gofiber/fiber/v2/middleware/logger"
|
||
)
|
||
|
||
func init() {
|
||
config.LoadConfig()
|
||
|
||
gocnjhelper.InitLogger(config.Cfg.Debug, true, false, "", "", "")
|
||
|
||
scylladb.InitDatabase()
|
||
|
||
go rabbitmq.Init()
|
||
}
|
||
|
||
func main() {
|
||
app := fiber.New()
|
||
|
||
//app.Use(cors.New())
|
||
|
||
app.Static("/dist", "dist")
|
||
|
||
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)
|
||
}
|