This repository has been archived on 2020-08-13. You can view files and clone it, but cannot push or open issues or pull requests.
requestor/lib/index.ts

22 lines
562 B
TypeScript

import { App } from '@types/express/index.d.ts';
import Handler from './classes/Handler.ts';
/**
* register an array of handlers to an express app
*
* @param {App} app express app
* @param {Array<Handler>} handlers handlers to register
*/
export default function load_handlers (
app: App,
handlers: array<Handler>
): void {
for (const h of handlers)
app.use (h.path, h.run_http_handler);
}
export * from './classes/Session.ts';
export * from './classes/Status.ts';
export * from './classes/Transaction.ts';
export * from './classes/Handler.ts';