mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-08-26 13:01:44 -04:00
19 lines
284 B
JavaScript
19 lines
284 B
JavaScript
|
/**
|
||
|
* 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);
|
||
|
};
|