a year ago
Here is the folder structure of my monorepo
/
/apps
/api
/web
/packages
/database
After bun run build is done, I tried to run backend using bun run api:start:prod, but I got this error message from the log:/app/apps/api/dist/main not found.
Please help me to set correct run command.
In your reply, please tell me how to deploy Next.js frontend under the /apps/web folder.
Thank you in advance!
ⓘ Deployment information is only viewable by project members and Railway employees.
5 Replies
a year ago
First let's focus on getting the backend up and running before we worry about the frontend.
Need a little more context though.
Do you currently have a root directory set? (just a Y/N question)
a year ago
I have set the root directory as /, but actually it's the default value, isn't it?
a year ago
Sounds good, please implement an api specific build script that builds the api app only and then use that as your service build command.
a year ago
/packages/database generates prisma client, so during build, database package is needed to build as well.
Actually, bun run build works well, but I don't know where the dist folder is generated. If I know the path, I can customize the app running command, like cd /path/to/dist && node main.js
a year ago
You don't want to use cd in this context it's not needed and would be the incorrect solution.
The path would be the same locally as it would be on Railway as long as you are using relative paths.