faas-runtime
- 支持koa(https://github.com/pillarjs/path-to-regexp)
- 支持egg(https://eggjs.org/zh-cn/advanced/loader.html#%E6%89%A9%E5%B1%95-loader)
Install
$ npm i --save faas-runtime
yml 文件规范
functions:json: ## 方法名handler: api.json.handler ## 函数名events:- http:path: / ## 请求路径method: ## 支持的方法- GETuser:handler: api.user.handlerevents:- http:path: /user/:idmethod:- GET- POST
如何使用
const App = 'egg' { ctx { console } console return } const app = './' app
Examples
测试用例
$ cd example && node appjs$ open http://localhost:3000/$ open http://localhost:3000/user/1