scratch-www/server/handler.js

19 lines
284 B
JavaScript
Raw Normal View History

/**
* Constructor
*/
function Handler (route) {
var url = '/' + route.view + '.html';
return function (req, res, next) {
req.url = url;
next();
};
}
/**
* Export a new instance
*/
module.exports = function (route) {
return new Handler(route);
};