From 8039d57a81277bfe436756df9d7e09a07fa7632b Mon Sep 17 00:00:00 2001 From: kirari04 Date: Wed, 3 Jan 2024 22:56:12 +0100 Subject: [PATCH] mapped webpages routes --- routes/api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routes/api.go b/routes/api.go index 2a55d4d..1e3709b 100755 --- a/routes/api.go +++ b/routes/api.go @@ -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) @@ -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)