web: add health and status endpoints

Signed-off-by: Nathan13888 <29968201+Nathan13888@users.noreply.github.com>
This commit is contained in:
Nathan Chung 2023-05-23 18:38:44 -04:00
parent d745d9fa6a
commit a15609caaf
Signed by: n4chung
SSH Key Fingerprint: SHA256:/+NqYA5MfQIjjfwa4z16mw3Y+lxgY/Ml8wCeGnh6qBU
1 changed files with 15 additions and 1 deletions

View File

@ -8,8 +8,22 @@ func StartServer() error {
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World 👋!")
})
app.Get("/health", getHealth)
app.Get("/healthz", getHealth)
app.Get("/alive", getHealth)
app.Listen(":3000")
app.Get("/status", getStatus)
app.Listen(":4200") // TODO: custom port and address
return nil
}
func getHealth(c *fiber.Ctx) error {
return c.SendStatus(200)
}
func getStatus(c *fiber.Ctx) error {
// TODO: implement
return c.SendStatus(200)
}