Home > front end >  Is it safe to put env variables in the express server file
Is it safe to put env variables in the express server file

Time:11-11

Is it wrong to put env variables in the express server file ? is it going to be seen by any one?

env variables in server file

CodePudding user response:

You should include it in gitignore file so no one gets the repo has access to env variables, also if you are using docker make sure to let it know about your env files when you deploy it as a service, in case you are using cloud for hosting, include the env variables into the service configurations that way the info in the env file won't be exposed

CodePudding user response:

you should create an env file and put it in gitgnore so that in production you variables can not be exposed.This make env file not to be exposed on version control like git, but you will have to define those env variables in your third party hosting service provider.

  • Related