feat: full redy blog and admin panel

This commit is contained in:
d3m0k1d
2026-02-15 16:34:14 +03:00
parent 8d6225f136
commit 7f8d8373a9
18 changed files with 3236 additions and 39 deletions

View File

@@ -14,6 +14,10 @@ func Register(router *gin.Engine, db *sql.DB) {
handler_static := NewStaticHandlers()
router.GET("/health", func(c *gin.Context) { c.Status(200) })
v1 := router.Group("api/v1")
admin := v1.Group("admin")
{
admin.GET("/posts", auth.JWTMiddleware(), auth.RequireAdmin(), handler_posts.AdminGetAll)
}
v1.Static("/uploads", "/data/uploads")
v1.POST("/upload", auth.JWTMiddleware(), auth.RequireAdmin(), handler_static.PostStatic)
v1.GET("/upload/:file", handler_static.GetStatic)