MCPcopy Create free account
hub / github.com/loopbackio/loopback-next / controller

Method controller

packages/rest/src/rest.server.ts:611–615  ·  view source on GitHub ↗

* Register a controller class with this server. * * @param controllerCtor - The controller class * (constructor function). * @returns The newly created binding, you can use the reference to * further modify the binding, e.g. lock the value to prevent further * modifications. *

(controllerCtor: ControllerClass<ControllerInstance>)

Source from the content-addressed store, hash-verified

609 *
610 */
611 controller(controllerCtor: ControllerClass<ControllerInstance>): Binding {
612 return this.bind('controllers.' + controllerCtor.name).toClass(
613 controllerCtor,
614 );
615 }
616
617 /**
618 * Register a new Controller-based route.

Calls 2

toClassMethod · 0.80
bindMethod · 0.45

Tested by 15

givenControllerInAppFunction · 0.36
givenControllerInAppFunction · 0.36
givenControllerClassFunction · 0.36
constructorMethod · 0.36
bindControllerMethod · 0.36
givenControllerInServerFunction · 0.36
givenAClientFunction · 0.36
givenAClientFunction · 0.36
givenAnAppAndAClientFunction · 0.36
givenAClientFunction · 0.36
givenAClientFunction · 0.36
givenAClientFunction · 0.36