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
2020-04-09 11:11:19 +02:00

22 lines
553 B
TypeScript

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