Skip to content

Commit

Permalink
mapped webpages routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirari04 committed Jan 3, 2024
1 parent 8bf481e commit 8039d57
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions routes/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ func Api() {
// Routes that dont require authentication
inits.Api.Get("/config", controllers.GetConfig)
inits.Api.Get("/file/example", controllers.GetFileExample)
inits.Api.Get("/p/pages", controllers.ListPublicWebPage)
inits.Api.Get("/p/page", controllers.GetPublicWebPage)

// Routes that require to be authenticated
protectedApi := inits.Api.Group("", middlewares.Auth)
Expand All @@ -49,6 +51,8 @@ func Api() {
protectedApi.Delete("/server", middlewares.IsAdmin, controllers.DeleteServer)
protectedApi.Get("/servers", middlewares.IsAdmin, controllers.ListServers)

protectedApi.Post("/page", middlewares.IsAdmin, controllers.CreateWebPage)

protectedApi.Post("/webhook", controllers.CreateWebhook)
protectedApi.Put("/webhook", controllers.UpdateWebhook)
protectedApi.Delete("/webhook", controllers.DeleteWebhook)
Expand Down

0 comments on commit 8039d57

Please sign in to comment.