I'm generating/copying ejs files dynamically and put them in views folder and they work fine in development mode however in production mode it's not reflecting changes until I relaunch sails. How can I make it work in production mode as well?
I'm using simple fs create/update file operations to write to ejs file
Found the solution. Following posts helped me in that:
Sailsjs view caching (bug ?)
https://github.com/balderdashy/sails/issues/3513
http://expressjs.com/en/api.html
The reason is, express was cashing views in production mode, so on disabling that it worked.
sails.hooks.http.app.disable('view cache');
console.log("view-cache-disabled: " + sails.hooks.http.app.disabled("view cache"));
You have to use a watcher like forever, nodemon, or something else...
Install forever by running:
sudo npm install -g forever
Run it:
forever -w start app.js