2024-09-12 19:15:38 -04:00
|
|
|
// 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"
|
2024-09-15 20:01:52 -04:00
|
|
|
"git.smarteching.com/goffee/cup/controllers"
|
2024-09-15 20:19:30 -04:00
|
|
|
"git.smarteching.com/goffee/cup/hooks"
|
2024-09-12 19:15:38 -04:00
|
|
|
)
|
|
|
|
|
2024-09-15 20:01:52 -04:00
|
|
|
// Register the app controllers
|
2024-09-12 19:15:38 -04:00
|
|
|
func registerRoutes() {
|
2024-09-15 20:01:52 -04:00
|
|
|
controller := core.ResolveRouter()
|
2024-09-12 19:15:38 -04:00
|
|
|
//#############################
|
|
|
|
//# App Routes #####
|
|
|
|
//#############################
|
|
|
|
|
|
|
|
// Define your routes here...
|
2024-09-15 20:01:52 -04:00
|
|
|
controller.Get("/", controllers.WelcomeHome)
|
2024-10-07 19:12:28 -04:00
|
|
|
// Uncomment the lines below to enable theme demo
|
|
|
|
controller.Get("/themebase", controllers.Themedemo)
|
|
|
|
controller.Get("/themeform", controllers.Themeform)
|
2024-10-10 09:59:53 -04:00
|
|
|
controller.Get("/themecontent", controllers.Themecontent)
|
2024-10-07 19:12:28 -04:00
|
|
|
controller.Get("/themepanel", controllers.Themedemo)
|
2024-10-12 14:19:25 -04:00
|
|
|
controller.Get("/themeelements", controllers.ThemeElements)
|
2024-10-07 19:12:28 -04:00
|
|
|
|
2024-09-12 19:15:38 -04:00
|
|
|
// Uncomment the lines below to enable authentication
|
2024-10-07 19:12:28 -04:00
|
|
|
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)
|
|
|
|
|
2024-12-04 08:39:08 -05:00
|
|
|
// 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)
|
|
|
|
|
2024-09-15 20:19:30 -04:00
|
|
|
controller.Get("/dashboard", controllers.WelcomeToDashboard, hooks.AuthCheck)
|
2024-10-07 19:12:28 -04:00
|
|
|
|
2024-10-27 11:27:54 -04:00
|
|
|
// templates demos
|
|
|
|
controller.Get("/signout", controllers.Signout)
|
|
|
|
|
2024-10-07 19:12:28 -04:00
|
|
|
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)
|
2024-10-21 17:04:58 -04:00
|
|
|
|
|
|
|
controller.Get("/appsession", controllers.AppSession)
|
|
|
|
controller.Post("/appsession", controllers.AppSession)
|
2024-09-12 19:15:38 -04:00
|
|
|
}
|