a year ago
i have a discord bot that i am hosting on railway, and there is code that creates a json file and adds stuff to it, where can i access this new file? when i check on my GitHub its not there which makes sense but i dont see any option on railway to view for example the files that the bot is running on.
50 Replies
a year ago
Railway doesnt provide a natively Railway to view the files, if you've a volume (persistent storage) you could use a file explorer template, you would need to detach the volume from your bot, attach to the file browser template, read the file through the template and then attach again to your bot
https://railway.app/template/Nan7Bs
one more question tho, if my bot goes down for some reason and errors out, if i have auto restart on without redeploying the service, will it still use the same file from before it errord out or make a new one
a year ago
if you've a persistent volume, it'll still be there even after redeploys
a year ago
you're talking about the persistent volumes?
a year ago
a year ago
yep
a year ago
the folder path where your file is stored
nothing shows up, my main service is connected to a github tho does that affect anything
a year ago
no, do you know where that file is stored inside your bot?
a year ago
when it runs
a year ago
could you tell it to mount it somewhere else? ./src may cause issues
a year ago
even a folder inside ./src would be good. e.g. ./src/bot-file-folder/file.
i dont know where to mount it to, the file im refrencing is in src. sorry my internet is slow

a year ago
yep
a year ago
and also, are you using a Dockerfile?
a year ago
/app/src/
a year ago
yep
any way to quickley make a folder on github i dont wanna have to upload a new one
a year ago
in the name your file input place a folder_name/ to create it
a year ago
yep, you detach the volume to the template and modify through there
a year ago
and when you're done, just attach to your bot again

