Open xgqfrms opened 1 year ago
API Key 安全措施
.gitignore
process.env
# Linux 设置 env 变量名称 export OPENAI_API_KEY=1234567 # Linux 读取 env 变量名称 echo $OPENAI_API_KEY
console.log(`env =`, process.env.OPENAI_API_KEY); // export NODE_ENV=dev // export NODE_ENV=prod
https://nodejs.dev/en/learn/how-to-read-environment-variables-from-nodejs/
https://www.npmjs.com/package/dotenv
https://www.npmjs.com/package/cross-env
https://www.youtube.com/watch?v=hZUNMYU4Kzo
https://www.cnblogs.com/jiaoshou/p/12187504.html
Node.js & NODE_ENV & process.env & .env file
.gitignore
process.env
refs
https://nodejs.dev/en/learn/how-to-read-environment-variables-from-nodejs/
https://www.npmjs.com/package/dotenv
https://www.npmjs.com/package/cross-env