1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | Object.defineProperty(exports, "__esModule", { value: true });
|
7 | exports.Route = void 0;
|
8 | const core_1 = require("@loopback/core");
|
9 | const keys_1 = require("../keys");
|
10 | const base_route_1 = require("./base-route");
|
11 | class Route extends base_route_1.BaseRoute {
|
12 | constructor(verb, path, spec, _handler) {
|
13 | super(verb, path, spec);
|
14 | this.spec = spec;
|
15 | this._handler = _handler;
|
16 | }
|
17 | describe() {
|
18 | return `${super.describe()} => ${this._handler.name || this._handler.toString()}`;
|
19 | }
|
20 | updateBindings(requestContext) {
|
21 | requestContext.bind(keys_1.RestBindings.OPERATION_SPEC_CURRENT).to(this.spec);
|
22 | }
|
23 | async invokeHandler(requestContext, args) {
|
24 |
|
25 |
|
26 | return (0, core_1.invokeMethodWithInterceptors)(requestContext, this, '_handler', args, { source: new base_route_1.RouteSource(this) });
|
27 | }
|
28 | }
|
29 | exports.Route = Route;
|
30 |
|
\ | No newline at end of file |