MCPcopy Index your code
hub / github.com/restify/node-restify / handlerFactory

Function handlerFactory

test/plugins/conditionalHandler.test.js:17–25  ·  view source on GitHub ↗
(response, version)

Source from the content-addressed store, hash-verified

15var PORT;
16
17function handlerFactory(response, version) {
18 return function handler(req, res, next) {
19 res.send(response);
20 if (version) {
21 assert.equal(req.matchedVersion(), version);
22 }
23 next();
24 };
25}
26
27describe('conditional request', function() {
28 describe('version', function() {

Callers 1

Calls 1

nextFunction · 0.70

Tested by

no test coverage detected