A lot more tests

This commit is contained in:
Hein
2025-12-08 16:56:48 +02:00
parent aeae9d7e0c
commit c9eaf84125
28 changed files with 4036 additions and 444 deletions

View File

@@ -128,15 +128,17 @@ func SetupMuxRoutes(muxRouter *mux.Router, handler *Handler, authMiddleware Midd
}
// Register routes for this entity
// IMPORTANT: Register more specific routes before wildcard routes
// GET, POST for /{schema}/{entity}
muxRouter.Handle(entityPath, entityHandler).Methods("GET", "POST")
// GET for metadata (using HandleGet) - MUST be registered before /{id} route
muxRouter.Handle(metadataPath, metadataHandler).Methods("GET")
// GET, PUT, PATCH, DELETE, POST for /{schema}/{entity}/{id}
muxRouter.Handle(entityWithIDPath, entityWithIDHandler).Methods("GET", "PUT", "PATCH", "DELETE", "POST")
// GET for metadata (using HandleGet)
muxRouter.Handle(metadataPath, metadataHandler).Methods("GET")
// OPTIONS for CORS preflight - returns metadata
muxRouter.Handle(entityPath, optionsEntityHandler).Methods("OPTIONS")
muxRouter.Handle(entityWithIDPath, optionsEntityWithIDHandler).Methods("OPTIONS")