Turborepo deployment

Project ID: baf32686-aca8-4ef9-8696-294e237d314a I want to deploy app that is written in Next.js and Fastify. I deployed them as a "Deploy from repository", and it deployed frontend and assigned domain to it, but I don't know how to make request to backend. In logs i can see the service is running. I tried to deploy them as 2 different services on railway but it cannot find pnpm-lock.yaml file since it is in root directory.
Solution:
Okay, I managed to deploy my app. I had to create 2 railway services, one that build and run frontend only with --filter flag, and the same for backend.
Jump to solution
8 Replies
Percy
Percy10mo ago
Project ID: baf32686-aca8-4ef9-8696-294e237d314a
MantisInABox
MantisInABox10mo ago
Maybe this can be of some assistance https://docs.railway.app/deploy/monorepo
Railway Docs
Monorepo Support | Railway Docs
Documentation for Railway
Solution
oskarpuchalski
oskarpuchalski10mo ago
Okay, I managed to deploy my app. I had to create 2 railway services, one that build and run frontend only with --filter flag, and the same for backend.
oskarpuchalski
oskarpuchalski10mo ago
However, I have another question. Can i have generated subdomains for my app? I need to have api subdomain to make CORS work. Can i do it on railway, or I need to do it with my domain?
MantisInABox
MantisInABox10mo ago
From the service, you can select settings, and then generate domain
oskarpuchalski
oskarpuchalski10mo ago
I did it. I asked wether I can generate subdomains, so i I have backend on api.x.railway.app and frontend on x.railway.app
MantisInABox
MantisInABox10mo ago
Oh, my apologies. I misread. Subdomains are not available for the generated domains.
oskarpuchalski
oskarpuchalski10mo ago
Thank you