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:Jump to 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
8 Replies
Project ID:
N/A
N/A
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
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
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?
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
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.
if you wanna use nginx thats no problem either, if you need my help with anything please come bug me