UNPKG

@webda/core

Version:

Expose API with Lambda

24 lines (18 loc) 529 B
import { Bean, Store } from "@webda/core"; @Bean 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; } @Webda.Route("/route1") _template() {} @Webda.Route("/route2", ["GET", "POST"]) _default(ctx) {} }