package main import ( api "example.com/api" authdiscord "example.com/auth/discord" database "example.com/database" "github.com/gin-gonic/gin" ) func main() { api.GlobalDatabase = database.InitializeDatabase() api.GlobalConfig.ParseConfig("../config.toml") api.GlobalOAuth = authdiscord.CreateDiscordOAuthConfig(api.GlobalConfig) app := gin.Default() // Authentication Workflow app.GET("/auth/callback", api.AuthCallback) app.GET("/auth/login", api.AuthLoginRedirect) app.GET("/auth/logout", api.AuthLogoutRedirect) // Create & Update app.POST("/post/user/update", api.CreateOrUpdateUser) app.POST("/post/group", api.CreateGroup) app.POST("/post/function", api.CreateFunction) app.POST("/post/function-tag", api.CreateFunctionTag) // Read app.GET("/get/user/info", api.GetDiscordUser) app.GET("/get/user/authorized", api.GetUserLoggedIn) app.GET("/get/groups", api.GetGroups) app.GET("/get/all/groups", api.GetAllGroups) app.GET("/get/functions", api.GetFunctions) app.GET("/get/all/functions", api.GetAllFunctions) app.GET("/get/function-tags", api.GetFunctionTags) app.GET("/get/all/function-tags", api.GetAllFunctionTags) // Delete app.Run(":31337") }