Skip to content

Instantly share code, notes, and snippets.

@heriberto-codes
Created October 16, 2021 04:59
Show Gist options
  • Select an option

  • Save heriberto-codes/fbf015f52434a7d177f68928e5d76f37 to your computer and use it in GitHub Desktop.

Select an option

Save heriberto-codes/fbf015f52434a7d177f68928e5d76f37 to your computer and use it in GitHub Desktop.
Setting NODE_ENV for production or development
process.env.NODE_ENV="production";
if(process.env.NODE_ENV === 'production') {
// We are running in production mode
} else {
// We are running in development mode
}
console.log(`We are running in ${process.env.NODE_ENV} mode 🏃‍♂️`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment