Files
server/SpellChecker/node_modules/express/lib/middleware/init.js
Alexander.Trofimov 2d017ea955 Добавил package.json для установки spellChecker.
Обновил модули для работы.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/nodeJSProjects@61785 954022d7-b5bf-4e40-9824-e11837661b57
2016-05-18 10:37:03 +03:00

27 lines
571 B
JavaScript

/**
* Initialization middleware, exposing the
* request and response to each other, as well
* as defaulting the X-Powered-By header field.
*
* @param {Function} app
* @return {Function}
* @api private
*/
exports.init = function(app){
return function expressInit(req, res, next){
if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express');
req.res = res;
res.req = req;
req.next = next;
req.__proto__ = app.request;
res.__proto__ = app.response;
res.locals = res.locals || Object.create(null);
next();
};
};