using `not_found_handling = "single-page-application"` and a worker script together?

I'm trying to deploy an SPA using workers assets (https://developers.cloudflare.com/workers/static-assets/get-started/#deploy-a-full-stack-application)

but I'd also like to be able to 'fall back' to the worker script if the SPA's routing logic rejects the request.

Currently if I have something like

main = "src/index.ts"
[assets]
binding = "ASSETS"
directory = "./public"
not_found_handling = "single-page-application"


in my
wrangler.toml
file, and if I make a request to http://localhost:8787/foo/bar it gets routed to the worker at src/index.ts

I would expect this request be handled by public/index.html instead, where I could then decide if I want to route the request to the worker or render content based on the URL

Is this possible? Thanks!
Was this page helpful?