Page Contents
Home > @loopback/rest > createRoutesForController
createRoutesForController() function
Create routes for a controller with the given spec
Signature:
export declare function createRoutesForController<T extends object>(spec: ControllerSpec, controllerCtor: ControllerClass<T>, controllerFactory?: ControllerFactory<T>): ControllerRoute<T>[];
Parameters
Parameter | Type | Description |
---|---|---|
spec | ControllerSpec | Controller spec |
controllerCtor | ControllerClass<T> | Controller class |
controllerFactory | ControllerFactory<T> | (Optional) Controller factory |
Returns:
ControllerRoute<T>[]