Multiplex Koa's middleware.
$ npm i koa-middleware-multiplexer
const multiplexer = require('koa-middleware-multiplexer'); router.post('/user', multiplexer.multiplex( (ctx) => ctx.query.type, [ ['admin', signUpAdmin], ['user', signUpUser], ], ));
function multiplex(condition, functions, options = { errorHandler, checkExist: false })
function errorHandel(ctx, error) { ctx.response.status = error.status || error.statusCode || 500; ctx.response.body = { message: error.message || 'Undefined error' }; }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4