Setup Node.js Server and Environment variables in windows/Linux Easily

  1. Create a new project folder: test_node, add app.js file now npm init
  2. Install pm2 in your Linux/ Windows machine by npm:
app.js
ecosystem.config.js
env: production/staging/development…
Now environment variable set successfully :)

Important pm2 commands

--

--

--

Full Stack Engineer (Web/App) working on different JS Technologies & frameworks— Angular, Node, Typescript, Ionic, Firebase, AWS, ElK...Love to write cool stuff

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Shivam Gupta

Shivam Gupta

Full Stack Engineer (Web/App) working on different JS Technologies & frameworks— Angular, Node, Typescript, Ionic, Firebase, AWS, ElK...Love to write cool stuff

More from Medium

Steve Madden clone using pure HTML, ExpressJS & MongoDB

Adding correlation-id to Node.js express-based application with log4js

How to solve the NodeJS error: “cannot use import statement outside a module”

When I was trying to install a reactjs web application, an error occurred.