From 4ea9f00059d3e74f010ba5f89cd1b2aff4eaf9aa Mon Sep 17 00:00:00 2001 From: Nathan13888 <29968201+Nathan13888@users.noreply.github.com> Date: Tue, 23 May 2023 18:50:47 -0400 Subject: [PATCH] web: add /api/project endpoint boilerplate Signed-off-by: Nathan13888 <29968201+Nathan13888@users.noreply.github.com> --- web/server.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/web/server.go b/web/server.go index 9fc5e85..bb91e45 100644 --- a/web/server.go +++ b/web/server.go @@ -5,8 +5,10 @@ import "github.com/gofiber/fiber/v2" func StartServer() error { app := fiber.New() + // TODO: authentication middleware? is it needed? + app.Get("/", func(c *fiber.Ctx) error { - return c.SendString("Hello, World 👋!") + return c.SendString("Hi! Why are you here? :)") }) app.Get("/health", getHealth) app.Get("/healthz", getHealth) @@ -14,11 +16,23 @@ func StartServer() error { app.Get("/status", getStatus) + app.Get("/api/project/:proj/all", getProjectAll) + app.Get("/api/project/:proj/status", getProjectStatus) + // TODO: initiate re-checks? + app.Listen(":4200") // TODO: custom port and address return nil } +func getProjectAll(c *fiber.Ctx) error { + return c.SendStatus(200) +} + +func getProjectStatus(c *fiber.Ctx) error { + return c.SendStatus(200) +} + func getHealth(c *fiber.Ctx) error { return c.SendStatus(200) }