22 lines
529 B
TypeScript
22 lines
529 B
TypeScript
import { App } from 'express';
|
|
import Handler from './classes/Handler';
|
|
|
|
/**
|
|
* 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';
|
|
export * from './classes/Status';
|
|
export * from './classes/Transaction';
|
|
export * from './classes/Handler';
|