flight-path
Version:
Express style router for Fastly Compute@Edge
14 lines (13 loc) • 358 B
JavaScript
export class Middleware {
constructor(matchFn, callback) {
this.matchFn = matchFn;
this.callback = callback;
}
check(event) {
return this.matchFn(event);
}
async run(req, res) {
// Supply an empty callback which would normally be next() in express
await this.callback(req, res, () => { });
}
}