update
This commit is contained in:
@@ -13,26 +13,29 @@ import (
|
||||
|
||||
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
// Get presigned URL for file download
|
||||
Method: http.MethodPost,
|
||||
Path: "/file/download",
|
||||
Handler: DownloadPresignedURLHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// Get presigned URL for file upload
|
||||
Method: http.MethodPost,
|
||||
Path: "/file/upload",
|
||||
Handler: UploadPresignedURLHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// Ping the server to check if it's alive
|
||||
Method: http.MethodGet,
|
||||
Path: "/ping",
|
||||
Handler: pingHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithMiddlewares(
|
||||
[]rest.Middleware{serverCtx.SuperAdminAuthMiddleware},
|
||||
[]rest.Route{
|
||||
{
|
||||
// Get presigned URL for file download
|
||||
Method: http.MethodPost,
|
||||
Path: "/file/download",
|
||||
Handler: DownloadPresignedURLHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// Get presigned URL for file upload
|
||||
Method: http.MethodPost,
|
||||
Path: "/file/upload",
|
||||
Handler: UploadPresignedURLHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// Ping the server to check if it's alive
|
||||
Method: http.MethodGet,
|
||||
Path: "/ping",
|
||||
Handler: pingHandler(serverCtx),
|
||||
},
|
||||
}...,
|
||||
),
|
||||
rest.WithPrefix("/api/blog"),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user