Files
go_blog/routers/router.go
2025-04-09 16:56:05 +08:00

25 lines
558 B
Go

package routers // Add the package declaration at the top
import (
"go_blog/controllers"
"net/http"
"github.com/gin-gonic/gin"
)
func RegisterRoutes(r *gin.Engine) {
// Frontend routes (dynamic themes)
r.GET("/", controllers.Home)
r.GET("/post/:id", controllers.ShowPost)
// // 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"))
}