file I/O on railway
I've got a Go script hosted on railway which creates a text file called data.txt and appends some data to it. this script is hosted from github. when I run it successfully runs and prints whatever it needs to print to the deploy terminal but the question is, where should I see the data.txt that has content in it? it isn't present in my github repo. but I know for a fact it successfully runs somewhere.
13 Replies
Project ID:
N/A
N/A
That file will be stored in your container, and will be deleted when your app restarts.
can I see the content of that file If I wanted to?
For persistent storage, you can look at https://docs.railway.app/reference/volumes.
Not currently, no.
that's pretty bad. thank you for the answer tho!
You can store your data in a database, and browse it that way.
You could also set up a simple static file server.
I could store it in a db, but need some filtering to the text file content first
gonna look way more messy if I dont save it in a text file first
^
thanks, where could I do that for free? 🙏
on railway?
You could set up a simple endpoint with https://pkg.go.dev/net/http
got it, дякую _)
I'm not actually Ukrainian (nor do I speak it), I just support them