Cloudflare DevelopersCD
Cloudflare Developers7mo ago
1 reply
anri

Workers SPA to serve nearest index.html

Would it be possible to make worker serve nearest index.html instead of root index.html when hitting a SPA route with "not_found_handling": "single-page-application"?

For example for this file structure:
/index.html
/app/index.html

When requesting something like domain.com/app/user/123 I'd like /app/index.html

Another approach would be to serve a specific predefined index.html instead of root. But I can't find anything about how to make this possible while still serving static assets without worker invocation.
Was this page helpful?