I have a bunch of secret keys that I want to keep in .env file and reference it in my app.js
I installed dotenv
In my app.env file
ROOMID =abcxyz
BOTEMAIL [email protected]
In my app.js
require('dotenv').config();
var roomID = process.env.ROOMID
var botEmail = process.env.BOTEMAIL
When I run app.js that uses roomID to send a message, it can't write the message because it can't find the roomID
If instead I directly use
var roomID = 'abcxyz'
var botEmail = '[email protected]'
then the program works. What am I missing?