@webda/core
Version:
Expose API with Lambda
24 lines (18 loc) • 529 B
JavaScript
import { Bean, Store } from "@webda/core";
export class AnnotedService extends Store {
constructor(webda, name, params) {
super(webda, name, params);
webda.registerRequestFilter(this);
if (this.parameters.brokenConstructor) throw Error();
}
async init() {
if (this.parameters.brokenInit) throw Error();
this.addRoute("/broken/{type}", ["GET"], this._brokenRoute);
return this;
}
.Route("/route1")
_template() {}
.Route("/route2", ["GET", "POST"])
_default(ctx) {}
}