Templating with Swig & Express
Express is a minimal and flexible Node.js web application framework. To install:
npm install express --save Swig is a simple, powerful, and extendable JavaScript Template Engine. To install:
npm install swig --save In this lines we are registering our swig engine in express as html and specifying our template directory
application.engine('html', swig.renderFile) application.set('view engine', 'html') application.set('views', __dirname + '/views') We can configure cache in our application as follows:
application.set('view cache', false) swig.
[Read More]