An `httpRouter` wrapper to provider SwaggerUI for local dev
npm install whook-swagger-ui[//]: # ( )
[//]: # (This file is automatically generated by a metapak)
[//]: # (module. Do not change it except between the)
[//]: # (content:start/end flags, your changes would)
[//]: # (be overridden.)
[//]: # ( )
httpRouter wrapper to provider SwaggerUI for local dev




[//]: # (::contents:start)
To use it, just wrap the HTTP router with this module and
register it again with the Knifecycle instance inside the
runServer function:
``js
import Knifecycle from 'knifecycle';
import {
runServer as runBaseServer,
prepareServer as prepareBaseServer,
} from 'whook';
import { initHTTPRouter } from 'swagger-http-router';
import wrapHTTPRouterWithSwaggerUI from 'whook-swagger-ui';
// It is important to do this in the runServer function since it really
// make sense only when actually running the server
export async function runServer(injectedNames = [], $ = new Knifecycle()) {
$.register(
wrapHTTPRouterWithSwaggerUI(initHTTPRouter),
);
return await runBaseServer(injectedNames, $);
}
export const prepareServer = prepareBaseServer;
`
[//]: # (::contents:end)
function initializer to also serve the
Swagger/OpenAPI UI for development purpose.Kind: global function
Returns: function - The
httpRouter initializer wrapped | Param | Type | Description |
| --- | --- | --- |
| initHTTPRouter | function | The
httpRouter` initializer |