added api endpoints

This commit is contained in:
2026-06-06 21:25:37 +02:00
parent 419e05bb89
commit 28bf03d1a3
7 changed files with 596 additions and 155 deletions

View File

@@ -77,11 +77,11 @@ func (this *Server) Run() {
mux.HandleFunc("/api/refresh", handlers.RefreshToken)
mux.Handle("/api/logout", auth.AuthMiddleware(this.JWTSecret)(http.HandlerFunc(handlers.Logout)))
mux.HandleFunc("/api/item", handlers.GetItems)
mux.HandleFunc("/api/locations", handlers.CreateLocation)
mux.HandleFunc("/api/project", handlers.CreateProject)
mux.HandleFunc("/api/stock/add", handlers.AddStock)
mux.HandleFunc("/api/project-items/add", handlers.AllocateToProject)
mux.Handle("/api/item", auth.AuthMiddleware(this.JWTSecret)(http.HandlerFunc(handlers.Item)))
mux.Handle("/api/location", auth.AuthMiddleware(this.JWTSecret)(http.HandlerFunc(handlers.Location)))
mux.Handle("/api/project", auth.AuthMiddleware(this.JWTSecret)(http.HandlerFunc(handlers.Project)))
mux.Handle("/api/stock", auth.AuthMiddleware(this.JWTSecret)(http.HandlerFunc(handlers.Stock)))
mux.Handle("/api/association", auth.AuthMiddleware(this.JWTSecret)(http.HandlerFunc(handlers.Associations)))
// Assets
mux.HandleFunc("/assets/", frontend.Assets)