decorators-router

0.0.6 • Public • Published

decorators-router

Alpha version

@Controller("/test")
export default class {

    @RequestMapping({value: "add", method: RequestMethod.POST})
    async add(ctx) {
        await service.doAction(ctx.request.body.files);
        ctx.redirect("/plugin/list");
    }

    @RequestMapping("/")// by default method GET
    async uploadPageView({render}, params) {
        await render("upload.html");
    }

    @RequestMapping("list")
    async list(ctx) {
        return service.getList();
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i decorators-router

Weekly Downloads

3

Version

0.0.6

License

MIT

Last publish

Collaborators

  • arshtepe