@webda/core
Version:
Expose API with Lambda
37 lines (31 loc) • 516 B
JavaScript
import { Ident as WebdaIdent } from "@webda/core";
/**
* @class
*/
export class Ident extends WebdaIdent {
static getActions() {
return {
plop: {},
index: {
global: true,
methods: ["GET"]
},
yop: {
methods: ["GET", "POST"]
}
};
}
yop() {
return "youpi";
}
canAct(ctx, action) {
return true;
}
static index(ctx) {
ctx.write("indexer");
}
plop(ctx) {
ctx.write({ _plop: true });
return Promise.resolve();
}
}