Velocity for express.js
First of all, install it with npm.
npm install --save-dev vext
Then write some codes in the entry file of express.js, such as app.js
.
var vext = require("vext");
// Set Velocity as the view engine
app.set("view engine", "vm");
// Use VEXT to render files
app.engine("vm", vext.__express);
You can view examples for detail. ;-)
There is only one API now. :-(
To rewrite the default settings of VEXT.
// The default layout is `template/layouts/default.vm`,
// to change it to `template/layouts/admin.vm`.
vext.set("layout", "template/layouts/admin.vm");