Generates a routes controller for the application container to mount.
const myController = controller((app) => { const router = app.getRouter(); const ctrl = new MyController(); return router.get('...', ctrl.doSomething()).post('...', ctrl.doSomethingElse()); }); // ... container.mount('/charo', myController); Copy
const myController = controller((app) => { const router = app.getRouter(); const ctrl = new MyController(); return router.get('...', ctrl.doSomething()).post('...', ctrl.doSomethingElse()); }); // ... container.mount('/charo', myController);
A function that will be called the moment the application mounts the controller, and that is in charge of registering routes and middlewares.
Generates a routes controller for the application container to mount.
Example