top 10 boilerplate ever
This commit is contained in:
commit
d0cc234857
17 changed files with 567 additions and 0 deletions
13
route.js
Normal file
13
route.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
function Route(deps, exec) {
|
||||
this.deps = deps;
|
||||
this.exec = exec;
|
||||
}
|
||||
|
||||
Route.prototype.run = async function (req, res, input) {
|
||||
for (let dep of this.deps) {
|
||||
input = await dep.run(req, res, input)
|
||||
};
|
||||
return await this.exec(req,res,input);
|
||||
}
|
||||
|
||||
export default Route;
|
Loading…
Add table
Add a link
Reference in a new issue