© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•2y ago•
3 replies
dog1283

Custom Routes - Best Practice for Workers as Microservices

Hi all - I am looking for someone to explain the best practice around setting up workers and domains. I am building a saas app with individual services. I have an auth service, data service, etc... I want to have them all sit on api.myapp.app/auth, api.myapp.app/data. I also want api-dev, api-stage subdomains. I have tried to assign a custom route to the service, but it doesn't work and in a way I am not surprised, because I don't have anything anchoring to my subdomain in the way I would have Nginx or even a load balancer in AWS. So, the question is, is there a way of having each service sit on a subroute of api.myapp.app, or do I need to setup a worker to act as a proxy for the other individual services, with the custom domain attached to it? My reticence with this is because every request I receive will essentially invoke two worker calls when it really should only need one. I have to believe there is a better way to do this! Thanks for all advice
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

best practice for composing workers?
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Logging Service Best Practice (Service Workers)
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Best practice for local development with multiple workers using RPC bindings?
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
2y ago
Workers Routes Replacement
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago