* feat: removes this bindings for cleaner, more maintainable code Co-authored-by: Elliot DeNolf <denolfe@users.noreply.github.com> Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
11 lines
288 B
TypeScript
11 lines
288 B
TypeScript
import { Router } from 'express';
|
|
import { Endpoint } from '../config/types';
|
|
|
|
function mountEndpoints(router: Router, endpoints: Endpoint[]): void {
|
|
endpoints.forEach((endpoint) => {
|
|
router[endpoint.method](endpoint.path, endpoint.handler);
|
|
});
|
|
}
|
|
|
|
export default mountEndpoints;
|