feat: added a single development cli command

This commit is contained in:
2023-02-03 00:45:32 +01:00
parent d33a4f25ff
commit d185e81ab2
4 changed files with 74 additions and 14 deletions
+6
View File
@@ -6,6 +6,7 @@ import (
"io"
"log"
"path"
"phc/website/services/config"
"phc/website/services/server/routes"
"phc/website/sl"
@@ -84,6 +85,11 @@ func Configure(l *sl.ServiceLocator) (*devService, error) {
return nil, err
}
config, _ := sl.Use(l, config.Slot)
if config.Mode != "development" {
return d, nil
}
r.Get("/api/development/routes", func(c *fiber.Ctx) error {
return c.JSON(map[string]any{
"static": d.staticRoutes,