Tuesday, May 26, 2020

using env-cmd to hide sensitive information (eg: API_KEY)

npm install env-cmd

add .env.development

in package.json

add to scripts: env-cmd -f .env.development

add to .env.development

REACT_APP_NAME=BEST APP

referencing to this varible in jsx:

{process.env.REACT_APP_NAME}


No comments:

Post a Comment