baibhavkumarpoudel / project3-backend

0 stars 0 forks source link

dotenv : cant find this module on nodeserver.js #2

Closed baibhavkumarpoudel closed 3 years ago

baibhavkumarpoudel commented 3 years ago

image image

  1. node server.js fails to run without dotenv. We were wondering if we needed to npm install anything regarding .env
  2. Skyler and I looked over some articles on the internet, but we are not clear on on the process w/o risking our code.
CRHarding commented 3 years ago

You only need dotenv if you are going to be using the env file (for example in the app.listen(process.env.PORT), to make things simple I suggest just getting rid of it and hard coding the port in (ie app.listen(3000). If you are using a third party api that is paid and need to keep your api key secret we can chat about that, but if not then I'd say skip it for now.