add routers themes
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package routers // Add the package declaration at the top
|
||||
|
||||
import (
|
||||
"go_blog/controllers"
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -8,15 +9,15 @@ import (
|
||||
|
||||
func RegisterRoutes(r *gin.Engine) {
|
||||
// Frontend routes (dynamic themes)
|
||||
r.GET("/", handlers.Home)
|
||||
r.GET("/post/:id", handlers.ShowPost)
|
||||
r.GET("/", controllers.Home)
|
||||
r.GET("/post/:id", controllers.ShowPost)
|
||||
|
||||
// Admin panel
|
||||
admin := r.Group("/admin", middleware.AuthRequired())
|
||||
{
|
||||
admin.GET("/themes", handlers.ListThemes)
|
||||
admin.POST("/themes/switch", handlers.SwitchTheme)
|
||||
}
|
||||
// // Admin panel
|
||||
// admin := r.Group("/admin", middleware.AuthRequired())
|
||||
// {
|
||||
// admin.GET("/themes", controllers.ListThemes)
|
||||
// admin.POST("/themes/switch", controllers.SwitchTheme)
|
||||
// }
|
||||
|
||||
// Static files for themes
|
||||
r.StaticFS("/themes", http.Dir("web/themes"))
|
||||
|
||||
Reference in New Issue
Block a user