@@ -18,7 +18,6 @@ func NewRouter(context *Context) *Router {
18
18
base := appbase .NewRouterBase (context .config .Config , []string {
19
19
"/health" ,
20
20
"/" ,
21
- "/static" ,
22
21
})
23
22
router := & Router {
24
23
Router : base ,
@@ -32,18 +31,17 @@ func NewRouter(context *Context) *Router {
32
31
33
32
// Admin API routes (protected by auth)
34
33
adminAPI := engine .Group ("/api/admin" )
34
+ adminAPI .Use (router .CorsMiddleware )
35
35
reprocessingAPI := adminAPI .Group ("/reprocessing" )
36
-
37
- reprocessingAPI .POST ("/jobs" , router .startReprocessingJob )
38
- reprocessingAPI .GET ("/jobs" , router .listReprocessingJobs )
39
- reprocessingAPI .GET ("/jobs/:id" , router .getReprocessingJob )
40
- reprocessingAPI .POST ("/jobs/:id/pause" , router .pauseReprocessingJob )
41
- reprocessingAPI .POST ("/jobs/:id/resume" , router .resumeReprocessingJob )
42
- reprocessingAPI .POST ("/jobs/:id/cancel" , router .cancelReprocessingJob )
36
+ reprocessingAPI .Match ([]string {"OPTIONS" , "POST" }, "/jobs" , router .startReprocessingJob )
37
+ reprocessingAPI .Match ([]string {"OPTIONS" , "GET" }, "/jobs" , router .listReprocessingJobs )
38
+ reprocessingAPI .Match ([]string {"OPTIONS" , "GET" }, "/jobs/:id" , router .getReprocessingJob )
39
+ reprocessingAPI .Match ([]string {"OPTIONS" , "POST" }, "/jobs/:id/pause" , router .pauseReprocessingJob )
40
+ reprocessingAPI .Match ([]string {"OPTIONS" , "POST" }, "/jobs/:id/resume" , router .resumeReprocessingJob )
41
+ reprocessingAPI .Match ([]string {"OPTIONS" , "POST" }, "/jobs/:id/cancel" , router .cancelReprocessingJob )
43
42
44
43
// Serve HTML interface for admin (no auth required for UI, auth handled via form)
45
44
engine .GET ("/" , router .serveAdminHTML )
46
- engine .Static ("/static" , "./static" )
47
45
48
46
return router
49
47
0 commit comments