Velocity for express.js
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
lib
.editorconfig
.gitignore
.npmignore
README.md
index.js
package.json

README.md

VEXT

Velocity for express.js

Usage

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. ;-)

APIs

There is only one API now. :-(

.set(key, value)

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");