Express 3.0 is here (finally) and while it is mostly a refinement release, between it and Connect 2.x there are some helpful new features. Sorry for the massive delay! Been busy and wanted to get a reasonable amount of documentation up on expressjs.com before releasing, more docs will be coming soon.
Keep in mind that the goal of Express is to aid you with HTTP, not to become a framework super-power like Rails, so this update may be underwhelming to some since it’s merely a refinement.
Changes introduced by Connect 2.x:
err.status
support to Connect’s default end-pointsession()
“proxy” setting to trust “X-Forwarded-Proto”cookieSession()
middlewarecompress()
middleware for gzipped responsesmultipart()
middlewarejson()
middlewareurlencoded()
middlewarelimit
option to the three above middlewaredefer
option to multipart()
to listen on formidable’s eventsdebug()
instrumentation to aid in debuggingbasicAuth()
’s req.remoteUser
to req.user
session()
to only set-cookie on modification (hashed session json)bodyParser()
to be an aggregate of json()
, multipart()
and urlencoded()
static()
’s logic into a separate npm module named “send”router()
middlewarelogger()
, now “utf8” instead of “ascii”fixed mount-path case-sensitivity
Connect docs are available at www.senchalabs.org/connect/, and will eventually be mirrored on expressjs.com as well for convenience, along with usage guides.
Changes introduced by Express 3.x:
./examples
res.jsonp()
to explicitly opt-in to JSONP supportres.send()
responsesres.send()
and res.redirect()
req.range(size)
to parse Range
header fieldsreq.auth
for basic authres.links(obj)
to set response the Link
header field for paginationres.format(obj)
for content-negotiationreq.fresh
for conditional-GETsreq.stale
for conditional-GETsres.redirect()
req.ip
for the remote address (supporting reverse proxies)req.ips
for remote address(es) (supporting reverse proxies)[]
support in jsonp callbackapp.get(name)
to compliment app.set(name, val)
app.engine()
to register template engines (replaces app.register()
)req.subdomains
to return an array of subdomainsreq.protocol
to return the request protocol string (“http” or “https”)req.secure
to assert that req.protocol
is “https”req.path
to return the parsed url’s pathnamereq.host
to return hostname (Host
void of port)debug()
instrumentation to aid debuggingreq.accepts()
req.acceptsLanguage()
req.acceptsCharset()
req.accepted
req.acceptedLanguages
req.acceptedCharsets
2
in dev)express.application
prototypeexpress.request
prototypeexpress.response
prototypeapp.render()
for app-level templatesres.type()
to replace old res.contentType()
{ signed: true }
option to res.cookie()
res.render()
, engines in consolidate.js work OOTBpartial()
res.signedCookie()
res.redirect('home')
supportreq.notify()
app.register()
app.redirect()
app.is()
app.helpers()
removed app.dynamicHelpers()
Head over to the New Features in 3.x wiki page for a more comprehensive list of additions, or to 3.x migration to help you upgrade if you wish to do so.
정식버전 등장..