Creates a "controller provider", which is a controller that can configure/extend the container before the application mounts it.
class MyController {} const myControllerProvider = controllerProvider((app) => { app.set('myController', () => new MyController()); return controller(() => { const ctrl = app.get<MyController>('myController'); const router = app.getRouter(); return router.get('/', ctrl.doSomething()); }); }); Copy
class MyController {} const myControllerProvider = controllerProvider((app) => { app.set('myController', () => new MyController()); return controller(() => { const ctrl = app.get<MyController>('myController'); const router = app.getRouter(); return router.get('/', ctrl.doSomething()); }); });
A function that will be called the moment the application mounts the controller provider.
Creates a "controller provider", which is a controller that can configure/extend the container before the application mounts it.
Example