Fixed api routes not being accessible
345422bc
Without the "run_workers_first" flag cloudflare tries rendering your react app on all /api calls
1 file(s) · +3 −1
Without the "run_workers_first" flag cloudflare tries rendering your react app on all /api calls
| 122 | 122 | "compatibility_date": "2025-05-25", |
|
| 123 | 123 | "assets": { |
|
| 124 | 124 | "directory": "./client/dist", // Path to client build folder |
|
| 125 | - | "not_found_handling": "single-page-application" // Handle SPA routing |
|
| 125 | + | "not_found_handling": "single-page-application", // Handle SPA routing |
|
| 126 | + | "run_worker_first": ["/api/*"] |
|
| 127 | + | ||
| 126 | 128 | }, |
|
| 127 | 129 | "compatibility_flags": ["nodejs_compat"] // Enable node for Vite path features |
|
| 128 | 130 | } |