Now the problem is that I have deployed the app, but things are still loading as if they are in development.
Reading on the web, it seems like I need to configure a dev build script and a production build script. When I do, I put a variable in there to indicated which type of production it is. Is that the best practice?
I think what I found right now is this script I can put in the server.js (sometimes app.js)
if(process.env.NODE_ENV === 'production') {
// We are running in production mode
var cache = require('express-redis-cache')({ expire: 604800 });
} else {
// We are running in development mode
console.log("development");
var cache = require('express-redis-cache')({ expire: 1 });
}
I am going to use it to have the redis cache last for a week in production, and for 1 second in dev mode.