added debugging
parent
355ea4296a
commit
12cff8e623
7
main.go
7
main.go
|
@ -9,6 +9,7 @@ import (
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"github.com/gofiber/fiber/v2/middleware/cors"
|
"github.com/gofiber/fiber/v2/middleware/cors"
|
||||||
|
flogger "github.com/gofiber/fiber/v2/middleware/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -23,6 +24,12 @@ func main() {
|
||||||
|
|
||||||
app.Use(cors.New())
|
app.Use(cors.New())
|
||||||
|
|
||||||
|
if config.Cfg.Debug {
|
||||||
|
app.Use(flogger.New(flogger.Config{
|
||||||
|
Format: "${pid} ${locals:requestid} ${status} - ${latency} ${method} ${path}\n",
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
router.SetupRoutes(app)
|
router.SetupRoutes(app)
|
||||||
|
|
||||||
app.Listen(config.Cfg.Host + ":" + config.Cfg.Port)
|
app.Listen(config.Cfg.Host + ":" + config.Cfg.Port)
|
||||||
|
|
Loading…
Reference in New Issue