doc/articles/signalr.md
SignalR is an ASP.NET Core library that allows server-side code to be instantly pushed to the client.
Create ASP.NET Core web application in Visual Studio and name it UnoChat.Service.
Add SignalR Hub to your [YourProjectName].Service project in a Hubs folder.
In your Startup.cs file, add your SignalR service and a CORS policy to the ConfigureServices method.
public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages();
services.AddSignalR();
services.AddCors(o => o.AddPolicy(
"CorsPolicy",
builder => builder
.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader()
));
}
In your Configure method, add your CORS policy and Hubs endpoint
app.UseCors("CorsPolicy");
app.UseEndpoints(endpoints =>
{
endpoints.MapRazorPages();
endpoints.MapHub<Hubs.[YourProjectHub]>("/yourProjectHub");
});
You now have a SignalR service that you can use with your Uno application!