feat: more reorganisation and keys endpoint

This commit is contained in:
DaanSelen
2026-04-23 16:51:18 +02:00
parent c3aac38089
commit 417cecf43f
10 changed files with 131 additions and 95 deletions
+7 -3
View File
@@ -19,14 +19,18 @@ func KickoffApi(logger *slog.Logger, env bootstrap.Environment, db *gorm.DB) {
gin.SetMode(gin.ReleaseMode)
// For a nice looking logger:
// r := gin.Default()
// JSON logger: https://gin-gonic.com/en/docs/logging/structured-logging/
// r := gin.Default() // default, this makes a nice looking log-trace but I want JSON
r := gin.New()
r.Use(middleware.SlogMiddleware(logger))
r.Use(gin.Recovery())
if env.AuthenticationEnabled {
slog.Debug("activating authentication middleware") // only log when actually doign the thing it logs to do
r.Use(middleware.AuthMiddleware())
}
api := r.Group("/api")
routes.RegisterApiRoutes(api /*env,*/, db)
routes.RegisterApiRoutes(api, db)
file := r.Group("/file")
routes.RegisterFileRoutes(file, env, db)