9 months ago
I have created a python webapp using fast-api. I want to update a certain file that's in my project directory named as "cookies.txt" when the api url is called. Is it possible by writing '/cookies.txt' or is there any other path that should be called by my code?
20 Replies
9 months ago
A couple points here.
For persistent storage, you'll want to be using Railway's Volumes feature. If you don't, every time you push a commit or update your code, the filesystem will reset and your cookies.txt file will be lost
You'll want to store your cookies.txt file in the volume once you've set that up. The path is up to you, but make sure it's saved in that volume.
Also I just wanna use my cookies.txt as a temporary file, I dont care if the contents get reset for it
9 months ago
It was changed recently, I believe it lasts for 30 days or however long it takes for your app to use 5$ worth of resources, whichever is first
9 months ago
Then your cookies file is saved wherever your code saves it. That's not something I can answer
I programmed my code to save the cookie file in the main directory like this

This is on vs code tho, I do not know the path format to call this file on railway
9 months ago
It will be the same
9 months ago
If it's in your app directory locally, it will be in your app directory on Railway
9 months ago
To familiarize yourself with the filesystem on Railway, try running the "ls" command through your app and logging it. You'll be able to see all your files and directories in the current folder
9 months ago
You will have to test for yourself. logging will help you figure out the correct path to use
9 months ago
Here are the CLI docs https://docs.railway.com/guides/cli
9 months ago
!s
Status changed to Solved adam • 9 months ago
