Generic—connect, restify, express—function to merge routes from a Map
.
Supported 'servers':
WiP:
npm i -S @offscale/routes-merger
import { routesMerger } from '@offscale/routes-merger';
routesMerger(/*IRoutesMergerConfig*/);
Some other file:
export const getUser = (app: restify.Server, namespace: string = ''): void =>
app.get(namespace, (req: restify.Request, res: restify.Response, next: restify.Next) => {
req.send(200, 'I am user');
return next();
};
See IRoutesMwConfig
interface.
Adding a new server? - Expand the IRoutesMwConfig
interface, and add a new short-function that implements it. See others for reference.
- Finish implementing Express, Connect and generic
- Tests
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.