import { Application , Request , Response , NextFunction } from 'express' ; import { Controller } from "../models/controller" ; import { Middleware } from '../models/middleware' ; param app param method param path param middleware param controller export default function transfer ( app , method , path , middleware , controller ) { switch ( method ) { case 'get' : app . get ( path , middleware , controller ) ; break ; case 'post' : app . post ( path , middleware , controller ) ; break ; case 'put' : app . put ( path , middleware , controller ) ; break ; case 'delete' : app . delete ( path , middleware , controller ) ; break ; default : throw new Error ( 'Unknown method requested for transfer: ' + method ) ; } } ;