35 lines
695 B
Go
35 lines
695 B
Go
package main
|
||
|
||
import (
|
||
"jannex/log-manager/modules/config"
|
||
"jannex/log-manager/modules/utils"
|
||
"jannex/log-manager/routers/router"
|
||
|
||
"github.com/gofiber/fiber/v2"
|
||
"github.com/gofiber/fiber/v2/middleware/cors"
|
||
"github.com/gofiber/fiber/v2/middleware/logger"
|
||
)
|
||
|
||
func init() {
|
||
config.LoadConfig()
|
||
utils.ValidatorInit()
|
||
|
||
utils.CreateDirectoryIfNotExists(config.Cfg.LogFolder)
|
||
}
|
||
|
||
func main() {
|
||
app := fiber.New(fiber.Config{
|
||
BodyLimit: 100 * 1024 * 1024,
|
||
})
|
||
|
||
app.Use(cors.New())
|
||
|
||
app.Use(logger.New(logger.Config{
|
||
Format: "${pid} ${locals:requestid} ${status} - ${latency} ${method} ${path}\n",
|
||
}))
|
||
|
||
router.SetupRoutes(app)
|
||
|
||
app.Listen(config.Cfg.Host + ":" + config.Cfg.Port)
|
||
}
|