import other kontor repos into directories

This commit is contained in:
Thomas Peetz
2025-01-09 19:28:50 +01:00
parent 8120c92b32
commit 9b329c0ac4
319 changed files with 17211 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
package setup
import (
"gitlab.thpeetz.de/kontor/kontor-go/pkg/admin"
"gitlab.thpeetz.de/kontor/kontor-go/pkg/auth"
"gitlab.thpeetz.de/kontor/kontor-go/pkg/comics"
"gitlab.thpeetz.de/kontor/kontor-go/pkg/library"
"gitlab.thpeetz.de/kontor/kontor-go/pkg/office"
"gitlab.thpeetz.de/kontor/kontor-go/pkg/tradingcards"
"gitlab.thpeetz.de/kontor/kontor-go/pkg/tysc"
"gitlab.thpeetz.de/kontor/kontor-go/pkg/util"
"github.com/gin-gonic/gin"
)
// InitializeRoutes setup the routes for Kontor web application.
func InitializeRoutes(router *gin.Engine) {
// Use the setUserStatus middleware for every route to set a flag
// indicating whether the request was from an authenticated user or not
router.Use(auth.SetSessionStatus())
// Handle the index route
router.GET("/", util.ShowIndexPage)
userRoutes := router.Group("/user")
{
userRoutes.GET("/login", auth.EnsureNotLoggedIn(), admin.ShowLoginPage)
userRoutes.POST("/login", auth.EnsureNotLoggedIn(), admin.PerformLogin)
userRoutes.GET("/logout", auth.EnsureLoggedIn(), admin.Logout)
}
admin.GetRoutes(router)
comics.GetRoutes(router)
library.GetRoutes(router)
office.GetRoutes(router)
tradingcards.GetRoutes(router)
tysc.GetRoutes(router)
}