README
@jambon/router
npm install @jambon/router
API
path
function path(path: string, ...reducers: (async context => context)[]) : async context => context
Import path
function:
import {path} from 'jambon-router'
Match requests where path starts with /api
:
const reducer = path('/api', ...reducers});
Match requests where path is exactly /api/foos
:
const reducer = path('/api/foos