Assuming you’ve already installed Node.js, create a directory to hold your application, and make that your
Events
req.acceptsEncodings(encoding [, ...]) Returns the first accepted encoding of the specified encodings, based on the request’s Accept-Encoding
Define error-handling middleware functions in the same way as other middleware functions, except error-handling functions have four arguments instead of three: (err,
router.use([path], [function, ...] function) Uses the specified middleware function or functions, with optional mount path path
req.fresh Indicates whether the request is “fresh.” It is the opposite of req.stale. It is true
res.status(code) Sets the HTTP status for the response. It is a chainable alias of Node’s
res.sendStatus(statusCode) Sets the response HTTP status code to statusCode and send its string representation as the response
How should I structure my application? There is no definitive answer to this question. The answer
res.jsonp([body]) Sends a JSON response with JSONP support. This method is identical to res.json(), except that it opts-in to JSONP
Page 5 of 11