Settings
app.set('x', 'yyy')
app.get('x')
app.enable('trust proxy')
app.disable('trust proxy')
app.enabled('trust proxy')
Env
app.get('env')
Config
app.configure('production', function() {
app.set...
})
Wares
app.use(express.static(__dirname + '/public'))
app.use(express.logger())
Helpers
app.locals({
title: "MyApp",
})
Request & response
Request
req.path
req.url
req.xhr
req.method
req.params
req.params.name
req.params[0]
req.query.q
req.cookies
req.accepted
req.is('html')
req.is('text/html')
req.headers
req.headers['host']
req.headers['user-agent']
req.headers['accept-encoding']
req.headers['accept-language']
Response
res.redirect('/')
res.redirect(301, '/')
res.set('Content-Type', 'text/html')
res.send('hi')
res.send(200, 'hi')
res.json({ a: 2 })