Closed futurist closed 8 years ago
This used to be possible, but I removed the feature recently, because requiring all definitions be provided to the registry upfront ends up dramatically simplified some of the internal logic and reduced the possibility for bugs. See this commit message for more context.
So, I'd suggest just adding definitions to the registryDefinition
object (from your samle code) over time, but don't pass that object to the registry until it's all ready.
after update registryDefinition
when service already started, how to restart the service in code with minimum reset? that to say,
// Initialize the automatic documentation.
var DocsController = new API.controllers.Documentation(registry, {name: 'Example API'});
// Set up our controllers
var APIController = new API.controllers.API(registry);
var Front = new API.httpStrategies.Express(APIController, DocsController);
var requestHandler = Front.apiRequest.bind(Front);
if want to use new registryDefinition, need re-construct all 4 variables? seems heavy; any light way to restart the service?
Out of curiosity, why do you need to update the registry after the service has already started? (When I changed the registry code earlier to require all definitions upfront, I assumed that updating it after the service started wouldn't be necessary. But, if there's a good reason for this, I'm happy to reconsider my earlier change.)
How to dynamicly update(add remove update) the model definition and registry definition?
Like the below demo code