forked from expressjs/express
-
Notifications
You must be signed in to change notification settings - Fork 0
Migrating from 2.x to 3.x
visionmedia edited this page Nov 10, 2011
·
48 revisions
- res.render() "status" option (use res.statusCode=)
- res.render() "charset" option (use res.charset=)
- app.dynamicHelpers() (use app.locals.use(callback))
- app.helpers() (use app.locals)
- app.VERB(path) for route lookup
- the concept of a "layout" (template engine specific now)
- partial() (template engine specific)
- res.partial()
- "view options" setting, use app.locals
- "hints" setting
- req.isXMLHttpRequest (use req.xhr)
- app.error() (use middleware with (err, req, res, next))
- res.send(body[, code]) is now res.send([code,] body)
- res.redirect(url[, code]) is now res.redirect([code,] url)
- res.json(obj[, code]) is now res.json([code,] obj)
- renamed app.register() to app.engine()
- app "root" setting
- app.get(setting) => value
- req.secure to check if the request was made via HTTPS
- req.path to grab the url pathname
- new tests using mocha
- res.set(field, value) to set a header field value
- res.set(obj) to set several values
- res.locals.NAME = val
- res.locals(obj) to set several locals
- app.locals.NAME = val
- app.locals(obj) to set several app-level locals
- app.render()
- res.type() alias of res.contentType()
- res.clearCookie() "path" defaults to the "root" setting
- res.cookie() "path" defaults to the "root" setting
- res.headerSent
- res.charset=
- req.stale
- req.fresh
- JSON cookie support
- signed cookie support
- several subtle res.sendfile() bugs