-
Notifications
You must be signed in to change notification settings - Fork 389
/
Copy pathProgram.cs
34 lines (27 loc) · 989 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using Azure.Identity;
using Microsoft.Azure.SignalR;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSignalR().AddAzureSignalR(option =>
{
// Here are sample codes for sovereign clouds
//
// var credentialOptions = new ClientSecretCredentialOptions()
// {
// AuthorityHost = AzureAuthorityHosts.AzurePublicCloud,
// // AuthorityHost = AzureAuthorityHosts.AzureGovernment, // for fairfax region
// // AuthorityHost = AzureAuthorityHosts.AzureChina, // for mooncake region
// };
// var tenantId = "";
// var clientId = "";
// var clientSecret = "";
// option.Endpoints = new ServiceEndpoint[] {
// new(new Uri("https://<hostname>"), new ClientSecretCredential(tenantId, clientId, clientSecret, credentialOptions))
// };
});
var app = builder.Build();
app.UseHttpsRedirection();
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseRouting();
app.MapHub<ChatSampleHub>("/chat");
app.Run();