Deploying a monorepo on one domain

I know the traditional monorepo structure may separate a frontend and a backend, but let's say I want to separate a client-frontend and an admin-frontend. Both of these will be run using their own express instance, with separate ports. They would be accessed like such: Client - www.domain.com/client Admin - www.domain.com/admin Where domain.com is the same domain name. Can this be done with Railway or will they require separate domain name registrations?
Solution:
it sure can, though not natively, you would need to run a proxy service, the proxy service would have the www.domain.com domain registered to it and proxy out requests based on the path to the appropriate service through the private network
Jump to solution
8 Replies
Percy
Percy15mo ago
Project ID: N/A
Dramamine
DramamineOP15mo ago
N/A
Solution
Brody
Brody15mo ago
it sure can, though not natively, you would need to run a proxy service, the proxy service would have the www.domain.com domain registered to it and proxy out requests based on the path to the appropriate service through the private network
Brody
Brody15mo ago
for a good starting point you can check out this template https://railway.app/template/7uDSyj you will need to modify the caddyfile to suite your needs though, so let me know if you need help with that
Dramamine
DramamineOP15mo ago
You really like Caddy, don't you? : ) Thanks for the link. Would I just deploy my separate services under the same project as the caddy service to implement this?
Brody
Brody15mo ago
yes you would, since the private network is only available to the services in the same project in the same environment and yeah i really do like caddy, its much more approachable than something like nginx or traefik in my opinion
Dramamine
DramamineOP15mo ago
I've always had much more success with nginx than caddy. But it has been a few years since I last looked into it. Thanks for the help! If I run into any issues implementing I'll bug you.
Brody
Brody15mo ago
if you wanna use nginx thats no problem either, if you need my help with anything please come bug me
Want results from more Discord servers?
Add your server