update
All checks were successful
CI - Build and Push / Build and Push Docker Image (push) Successful in 52s
All checks were successful
CI - Build and Push / Build and Push Docker Image (push) Successful in 52s
This commit is contained in:
@@ -24,6 +24,30 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
rest.WithPrefix("/api/blog"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
// Get a blog post by ID
|
||||
Method: http.MethodPost,
|
||||
Path: "/post",
|
||||
Handler: GetPostHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// Get a list of blog posts
|
||||
Method: http.MethodPost,
|
||||
Path: "/posts",
|
||||
Handler: ListPostsHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// Get a list of blog tags
|
||||
Method: http.MethodPost,
|
||||
Path: "/tags",
|
||||
Handler: ListTagsHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithPrefix("/api/blog/view"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
rest.WithMiddlewares(
|
||||
[]rest.Middleware{serverCtx.SuperAdminAuthMiddleware},
|
||||
@@ -58,17 +82,17 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
{
|
||||
// Get presigned URL for file download
|
||||
Method: http.MethodPost,
|
||||
Path: "/file/download",
|
||||
Path: "/download",
|
||||
Handler: DownloadPresignedURLHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// Get presigned URL for file upload
|
||||
Method: http.MethodPost,
|
||||
Path: "/file/upload",
|
||||
Path: "/upload",
|
||||
Handler: UploadPresignedURLHandler(serverCtx),
|
||||
},
|
||||
}...,
|
||||
),
|
||||
rest.WithPrefix("/api/blog"),
|
||||
rest.WithPrefix("/api/blog/file"),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user