Page Contents
Home > @loopback/rest > ControllerRoute > (constructor)
ControllerRoute.(constructor)
Construct a controller based route
Signature:
constructor(verb: string, path: string, spec: OperationObject, controllerCtor: ControllerClass<T>, controllerFactory?: ControllerFactory<T>, methodName?: string);
Parameters
| Parameter | Type | Description |
|---|---|---|
| verb | string | http verb |
| path | string | http request path |
| spec | OperationObject | OpenAPI operation spec |
| controllerCtor | [ControllerClass](/doc/en/lb4/apidocs.rest.controllerclass.html)<T> | Controller class |
| controllerFactory | [ControllerFactory](/doc/en/lb4/apidocs.rest.controllerfactory.html)<T> | _(Optional)_ A factory function to create a controller instance |
| methodName | string | _(Optional)_ Controller method name, default to `x-operation-name` |