Last active
September 3, 2016 02:12
-
-
Save chrisenytc/13f8ccd1323694a6b1dd to your computer and use it in GitHub Desktop.
Example of use swig template engine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var App = require('express')(), | |
swig = require('swig'); | |
//Swig | |
swig.setDefaults({ | |
cache: 'memory' | |
}); | |
//assign the template engine to .html files | |
App.engine('html', swig.renderFile); | |
//set .html as the default extension | |
App.set('view engine', 'html'); | |
//Set views path, template engine and default layout | |
App.set('views', 'viewsfolderhere'); | |
App.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment