This is my first practice with Node/Express
I didn't do any error handling or focus on controller files. I feel like some things may also be suitable for
.envthat I haven't included.
- write the variables: create a
.envfile at the root of the directory - load the variables: when writing the CLI commands to run the app, use
--env-file=.envprior to referencing the app.- e.g.:
node --env-file=.env --watch app
- e.g.:
- access the variables: variable keys within
.envwill be accessible throughout the directory via Node's globalprocess.env.KEY_NAMEobject
- Ports -> MAIN_APP_PORT & BACK_APP_PORT
- are common ports, use what you want - I did 3000 and 5000