Skip to content
Writeable files on free 5$ Trial
notanerdstudent
OP

2 years 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?

Solved

19 Replies

notanerdstudent
OP

2 years ago

it was working few hours back but now it aint


notanerdstudent
OP

2 years ago

b1d658d0-4268-403e-b77a-af1d0011ee1f


2 years ago

A couple points here.

  1. 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

  2. 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.


notanerdstudent
OP

2 years ago

how long does the free trial take to expire btw?


notanerdstudent
OP

2 years ago

Also I just wanna use my cookies.txt as a temporary file, I dont care if the contents get reset for it


2 years 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


notanerdstudent
OP

2 years ago

ohh


2 years ago

Then your cookies file is saved wherever your code saves it. That's not something I can answer


notanerdstudent
OP

2 years ago

I programmed my code to save the cookie file in the main directory like this

1368272589218119700


notanerdstudent
OP

2 years ago

This is on vs code tho, I do not know the path format to call this file on railway


2 years ago

It will be the same


2 years ago

If it's in your app directory locally, it will be in your app directory on Railway


notanerdstudent
OP

2 years ago

does the path require updation then? If you could help me know

1368272978453860583


2 years 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


2 years ago

You will have to test for yourself. logging will help you figure out the correct path to use


notanerdstudent
OP

2 years ago

Ah Alright Thanks


notanerdstudent
OP

2 years ago

umm could u help me know how to enter the shell 😅


2 years ago


2 years ago

!s


Status changed to Solved adam • over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...