loopback-next icon indicating copy to clipboard operation
loopback-next copied to clipboard

Dynamic binding/rebinding of controllers after app start

Open bajtos opened this issue 9 years ago • 21 comments

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.

bajtos avatar Jul 13 '17 14:07 bajtos

PR https://github.com/strongloop/loopback-next/pull/4679 has landed. Closing as done.

dhmlau avatar Feb 25 '20 02:02 dhmlau