dog1283
dog1283
CDCloudflare Developers
Created by dog1283 on 6/22/2024 in #workers-help
Excluding Tests
Hi All. I am building a service with Workers and I have my tests in a subfolder of each controller "{controller_name}/specs". I am concerned about them bloating the package when I deploy to production. Does anyone know the correct and preferred way to exclude them from the production build?
4 replies
CDCloudflare Developers
Created by dog1283 on 3/31/2024 in #workers-help
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
4 replies