Skip to content

@tlack /express-js-dust-x-example.js
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
express-js and dust-x example app
/**
* Module dependencies.
*/
var express = require('express')
, dustx = require('dust-x')
/**
* Create the Express application.
*/
var app = module.exports = express.createServer()
/**
* Configure Express
*/
app.configure(function() {
app.set('views', __dirname + '/views')
app.register('.dust', dustx/*({})*/)
app.set('view engine', 'dust')
app.use(app.router)
})
app.configure('development', function() {
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }))
})
app.configure('production', function() {
app.use(express.errorHandler())
})
// Routes
app.get('/:path(*)', function(req, res) {
var path = req.param('path') || 'index'
res.render(path, { title: 'Express + Dust' })
})
// Only listen on $ node app.js
app.on('listening', function() {
console.log("Express server listening on port %d", app.address().port)
})
app.listen(3000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.