loopback-next
loopback-next copied to clipboard
Dynamic binding/rebinding of controllers after app start
Support hot-reloading of controllers after the app started. See Application.prototype._setupHandlerIfNeeded().
Example test case:
const app = new Application();
await app.start();
app.controller(MyController);
// MyController is available via REST API now
Acceptance criteria
When the application binds a controller after the app has started, the application picks up the endpoints contributed by the new controller.
- [ ] REST server is updated with new endpoints, so that clients can access the new API.
- [ ] OpenAPI specification of the application is updated to describe the new endpoints.
Nice to have:
- [ ] When a controller is removed from the application (e.g. via
app.unbind()API), the endpoints are removed from the REST server and the OpenAPI spec.
PR https://github.com/strongloop/loopback-next/pull/4679 has landed. Closing as done.