I typed npm start to run my program but this is the comment that U received in the terminal: express-session deprecated req.secret; provide secret option app.js:27:9. I don't understand how this issue needs to be fixed. This is the code from app.js:27:9
app.use(session({
store: new FileStore(),
secret: process.env.SESSION_SECRET,
resave: false,
saveUninitialized: true,
is_logged_in: false,
}))
Make sure you added the SESSION_SECRET in .env file. If yes, then in your app.js, add this
const dotenv = require('dotenv').config()
You need to load all your environment variables. at line one on the server.js file write this...
if (process.env.NODE_ENV !== 'production') { require('dotenv').config() }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With