This is a draft cheat sheet. It is a work in progress and is not finished yet.
General
var express = require('express');
|
|
Application
app.locals.title / strftime / email
|
|
app.use([path], callback)
|
|
app.post(path, callback)
|
|
app.delete(path, callback)
|
app.enable(name)
: Set to True |
app.disable(name)
: Set to False |
app.enabled(name)
: True if name is True |
app.disabled(name)
: True if name is False |
app.engine(ext, callback)
|
app.listen(path, callback)
|
app.param([name], callback)
|
app.render(view, [locals], callback)
|
|
|
|
|
|
Request properties
|
|
req.originalUrl
: req.baseUrl + req.path |
req.body
: Require MW body-parser & multer |
req.cookies
: Require MV cookie-parser |
req.signedCookies
: Require MV cookie-parser |
|
|
|
req.ip
: X-Forwarded-For |
req.method
GET / POST / PUT / DELETE ... |
req.params
Properties named route parameters |
|
|
|
req.secure
: TLS connection |
|
req.xhr
: X-Requested-With |
|
|
|