From b0bc80b4d6e6c6bd0ed5f24ecb8ec9fe004413a2 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Thu, 7 Jul 2016 14:58:25 +0100 Subject: [PATCH] Update docs around custom node instances to match latest API changes --- src/Microsoft.AspNetCore.NodeServices/README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Microsoft.AspNetCore.NodeServices/README.md b/src/Microsoft.AspNetCore.NodeServices/README.md index c771cfd..8fdb02a 100644 --- a/src/Microsoft.AspNetCore.NodeServices/README.md +++ b/src/Microsoft.AspNetCore.NodeServices/README.md @@ -349,11 +349,12 @@ The default transport may change from `Http` to `Socket` in the near future, bec ### Custom hosting models -If you implement a custom hosting model (by implementing `INodeServices`), then you can get instances of that just by using your type's constructor. Or if you want to designate it as the default hosting model that higher-level services (such as those in the `SpaServices` package) should use, register it with ASP.NET Core's DI system: +If you implement a custom hosting model (by implementing `INodeInstance`), then you can cause it to be used by populating `NodeInstanceFactory` on a `NodeServicesOptions`: ```csharp -services.AddSingleton(typeof(INodeServices), serviceProvider => -{ - return new YourCustomHostingModel(); -}); +var options = new NodeServicesOptions { + NodeInstanceFactory = () => new MyCustomNodeInstance() +}; ``` + +Now you can pass this `options` object to [`AddNodeServices`](#addnodeservices) or [`CreateNodeServices`](#createnodeservices).