feat: full redy blog and admin panel
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user