mirror of
https://github.com/m-lamonaca/dev-notes.git
synced 2025-05-14 15:16:27 +00:00
chore(dotnet): rework asp.net notes
This commit is contained in:
parent
8623a82b92
commit
19cb7961f7
11 changed files with 249 additions and 1215 deletions
|
@ -9,33 +9,14 @@ The SignalR Hubs API enables to call methods on connected clients from the serve
|
|||
In `Startup.cs`:
|
||||
|
||||
```cs
|
||||
namespace App
|
||||
builder.Services.AddSignalR();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public Startup(IConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
public IConfiguration Configuration { get; }
|
||||
|
||||
// This method gets called by the runtime. Use this method to add services to the DI container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSignalR();
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapHub("/hub/endpoint");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
endpoints.MapHub("/hub/endpoint");
|
||||
});
|
||||
```
|
||||
|
||||
### Creating Hubs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue