Hosting a monorepo with a Vite/Svelte Front and and a Fiber Backend
I am trying to host my monorepo application within railway however I am facing some issues when trying to deploy. Should i be using npm run dev as my run command? I was thinking of creating two railway instances one for the front end and the other for the back end while setting each respective root directory but I am not sure if this is the best option
11 Replies
Project ID:
4a299107-d7aa-41fc-8de7-34c9d4071a4d
4a299107-d7aa-41fc-8de7-34c9d4071a4d
- Should i be using npm run dev as my run command?
no you shouldn't, see the " Why use Caddy when deploying to Railway?" part of this templates readme https://github.com/brody192/vite-react-template
- I was thinking of creating two railway instances one for the front end and the other for the back end while setting each respective root directory but I am not sure if this is the best option
this would be the currect way to go about it!
thank you! also for the hobby plan, is there a way to set a upper bound limit on charge fee?
there is not, but if you enable usage alerts in your account settings youll get an email when you go one cent over 5$ lol
after reading i do not quite understand
when i initially used npm run dev as the deploy command it passed, however nothing was exposed to the internet
simply copying the nixpacks.toml and Caddyfile into your vite project should be enough
will i then be able to leave both build and start commands empty?
if i were to use npm run dev as my deploy command, do you know how I would expose it to the internet?
again, do not use that command
please use the nixpacks.toml and Caddyfile from my template repo
you should be able to
wanting to follow up, did you have any success?
I did, added the 2 files and it magically worked. I am not sure how but i am amazed. thank you so much!
how does the Caddy file know what to do
I recommend you read that repositories readme, and read the caddyfile itself