#.env file location

15 messages · Page 1 of 1 (latest)

slim lynx
#

RESOLVED

Hi,

I'm deploying a simple API project and cannot figure out where railway is storing the .env file.

I added the variable using the production interface, variables tab, raw editor, ENV.

Any help would be greatly appreciated.

Thanks!

#

Solved, by appending echo "$VAR_NAME" > .env to build command

lime condor
#

You shouldn't need the .env file. We automatically pipe your variables in.

#

Once you add your variable on your service, it should be available to it.

lean glen
#

how would i use the vars in my node app? ${var_name}?

lime condor
lean glen
#

ah great, so i can use it in dev mode as well as in production.

#

i thought i saw something like ${{varname}} somewhre in the docs

lime condor
#

You can use it in dev mode if you're using our CLI and starting your server with railway run CMD

lime condor
lean glen
#

yes, i would like to access the template vars in the dashbaord within my app.

lime condor
#

We just pipe the variables in. Using them within your app works the same way it would irrespective of where you run your app.