Ajouter routes /admin et /admin/documents/upload

This commit is contained in:
Victor Lacasse-Beaudoin 2023-04-26 19:28:20 -04:00
parent 2bfa133349
commit a1146d182f
3 changed files with 38 additions and 1 deletions

View file

@ -199,6 +199,8 @@ func RunServer() {
groupAdmin.GET("", handleAdmin)
groupAdmin.GET("/documents/upload", handleAdminDocumentsUpload)
e.Logger.Fatal(e.Start(
fmt.Sprintf(":%d", viper.GetInt("server.port"))))
}
@ -717,7 +719,11 @@ func handlePublicDocumentation(c echo.Context) error {
}
func handleAdmin(c echo.Context) error {
return c.JSON(http.StatusNotImplemented, map[string]string{"message": "Not Implemented"})
return c.Render(http.StatusOK, "admin-html", nil)
}
func handleAdminDocumentsUpload(c echo.Context) error {
return c.Render(http.StatusOK, "admin-upload-html", nil)
}
// CSS Handlers