Command To Create A New .env File In Ionic Nextjs Node.js Project React


Use this command to create a new environment file for your node projects such as ionic react nextjs

touch .env.local ; code .env.local

These environment variables will be defined for you on process.env. For example, having an environment variable named REACT_APP_API_KEY will be exposed in your JS as process.env.REACT_APP_API_KEY.

I hope this works for you.

Resources:

  1. https://create-react-app.dev/docs/adding-custom-environment-variables/
  2. https://nextjs.org/docs/basic-features/environment-variables