Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ffMathy authored Mar 4, 2023
1 parent 3279bca commit 73cb906
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ Add `AddNgrok` to your service registration

```csharp
var services = new ServiceCollection();
services.AddNgrok();

services.AddNgrok(options => {
options.AuthToken = "my auth token"; //optional - only needed if tunneling HTML
});

var serviceProvider = services.BuildServiceProvider();
var ngrokService = serviceProvider.GetService<INgrokService>();
Expand All @@ -33,7 +36,9 @@ For this example, the `FluffySpoon.Ngrok.AspNet` package has to be installed.
var builder = WebApplication.CreateBuilder();

//this is the line that is needed to automatically start the tunnel with your ASP .NET Core application.
builder.Services.AddNgrokHostedService();
builder.Services.AddNgrokHostedService(options => {
options.AuthToken = "my auth token"; //optional - only needed if tunneling HTML
});

builder.Services.AddControllersWithViews();

Expand Down

0 comments on commit 73cb906

Please sign in to comment.