cup/routes.go
2024-12-04 08:39:08 -05:00

62 lines
2.5 KiB
Go

// Copyright 2023 Harran Ali <harran.m@gmail.com>. All rights reserved.
// Copyright (c) 2024 Zeni Kim <zenik@smarteching.com>
// Use of this source code is governed by MIT-style
// license that can be found in the LICENSE file.
package main
import (
"git.smarteching.com/goffee/core"
"git.smarteching.com/goffee/cup/controllers"
"git.smarteching.com/goffee/cup/hooks"
)
// Register the app controllers
func registerRoutes() {
controller := core.ResolveRouter()
//#############################
//# App Routes #####
//#############################
// Define your routes here...
controller.Get("/", controllers.WelcomeHome)
// Uncomment the lines below to enable theme demo
controller.Get("/themebase", controllers.Themedemo)
controller.Get("/themeform", controllers.Themeform)
controller.Get("/themecontent", controllers.Themecontent)
controller.Get("/themepanel", controllers.Themedemo)
controller.Get("/themeelements", controllers.ThemeElements)
// Uncomment the lines below to enable authentication
controller.Post("/signup", controllers.Signup)
controller.Post("/signin", controllers.Signin)
controller.Post("/signout", controllers.Signout)
controller.Post("/reset-password", controllers.ResetPasswordRequest)
controller.Post("/reset-password/code/:code", controllers.SetNewPassword)
// Uncomment the lines below to enable user administration
controller.Get("/admin/users", controllers.AdminUsersList)
controller.Post("/admin/users", controllers.AdminUsersList)
controller.Get("/admin/users/add", controllers.AdminUsersAdd)
controller.Post("/admin/users/add", controllers.AdminUsersAdd)
controller.Get("/admin/users/edit/:id", controllers.AdminUsersEdit)
controller.Post("/admin/users/edit/:id", controllers.AdminUsersEdit)
//controller.Get("/admin/users/roles", controllers.Signout)
//controller.Get("/admin/users/permissions", controllers.ResetPasswordRequest)
//controller.Get("/admin/users/edit", controllers.SetNewPassword)
//controller.Get("/admin/users/cancel", controllers.SetNewPassword)
controller.Get("/dashboard", controllers.WelcomeToDashboard, hooks.AuthCheck)
// templates demos
controller.Get("/signout", controllers.Signout)
controller.Get("/appsample", controllers.AppSample, hooks.AuthCheck)
controller.Post("/appsample", controllers.AppSample, hooks.AuthCheck)
controller.Get("/applogin", controllers.AppLogin, hooks.CheckSessionCookie)
controller.Post("/applogin", controllers.AppLogin, hooks.CheckSessionCookie)
controller.Get("/appsession", controllers.AppSession)
controller.Post("/appsession", controllers.AppSession)
}