R
Railway16mo ago
iseiaki

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
Percy
Percy16mo ago
Project ID: N/A
iseiaki
iseiakiOP16mo ago
N/A
root
root16mo ago
That file will be stored in your container, and will be deleted when your app restarts.
iseiaki
iseiakiOP16mo ago
can I see the content of that file If I wanted to?
root
root16mo ago
For persistent storage, you can look at https://docs.railway.app/reference/volumes. Not currently, no.
iseiaki
iseiakiOP16mo ago
that's pretty bad. thank you for the answer tho!
root
root16mo ago
You can store your data in a database, and browse it that way. You could also set up a simple static file server.
iseiaki
iseiakiOP16mo ago
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
root
root16mo ago
^
iseiaki
iseiakiOP16mo ago
thanks, where could I do that for free? 🙏
root
root16mo ago
on railway? You could set up a simple endpoint with https://pkg.go.dev/net/http
iseiaki
iseiakiOP16mo ago
got it, дякую _)
root
root16mo ago
I'm not actually Ukrainian (nor do I speak it), I just support them
Want results from more Discord servers?
Add your server