How to use railway with monorepo?
I created a new project and essentially my server code is not at the top level, and instead is one directory down. How do I configure this with railway?
104 Replies
Project ID:
N/A
N/A
should have known there was going to be a setting for this. but in my defense... i did try to search for it and i got no hits. but of course i try now and its there in settings. š¤¦āāļø
thanks Brody!
I wonder if i have to move my custom nixpack.toml into the new root folder... hmmmm
you would likely have the nixpacks.toml in the subfolder and then set the location to it with the
NIXPACKS_CONFIG_FILE
variablethanks. just moved it to the subfolder, so I will give that a shot. still find it weird that variables cant be in version control (like PORT 8080)
wdym version control? like github?
yeah
its a variable that controls the platform, so it needs to be set on the platform itself
but side node, there would be no need for you to set a PORT variable yourself as long as your app listens on the automatically generated PORT variable
oh hmmm. i wonder if i can do that on ktor. i guess the auto generated port variable is set as an env variable?
yep it would be an environment variable, and yes you can do it with ktor, remove the PORT variable you set, now railway will randomly assign one behind the scenes, now all your app has to do is read the PORT environment variable and listen on it
very cool. thanks for teaching.
cant seem to get railway to use my /server directory. lmao
![No description](https://cdn.answeroverflow.com/1214732906015100969/CleanShot_2024-03-05_at_19.34.142x.png)
what makes you think that?
![No description](https://cdn.answeroverflow.com/1214733120499224616/CleanShot_2024-03-05_at_19.35.352x.png)