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