#Can Worker Routes be used to host a separate backend on the same domain where the web app is hosted?

2 messages · Page 1 of 1 (latest)

hollow pivot
#

Say we have domain.com where on app1.domain.com we host our app. This app has a front-end you'd access by going to app1.domain.com (or any other sub-domain like app1.domain.com/my/route). The web-app, a mobile app, or a third-party service might need to fetch data, ideally from app1.domain.com/api/requested/resource. Can I host the front-end with Workers/Pages on—by default—all routes on that subdomain, but "reserve" /api/* to be used by a separate worker running the backend code?

hollow pivot
#

Ideally I'd like to handle all this with wrangler.toml files for each, rather than going through the UI