Pambda for routing.
npm i pambda-router
import { compose, createLambda } from 'pambda';
import { router } from 'pambda-router';
export const handler = createLambda(
compose(
router()
.get('/', next => (event, context, callback) => {
})
.toPambda()
)
);
Create a Router instance.
Specify Pambda when a request for a method specified by HTTP_METHOD
arrives for the resource specified by path
.
The following can be specified as HTTP_METHOD
:
head
get
post
put
delete
patch
options
For the format of path
, see path-to-regexp.
Specify Pambda when any method request arrived for the resource specified by path
.
Returns Pambda which synthesized routings.
MIT