mirror of
https://github.com/ckaczor/WeatherService.git
synced 2026-01-13 17:23:11 -05:00
Initial commit
This commit is contained in:
20
SignalR/Startup.cs
Normal file
20
SignalR/Startup.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Microsoft.AspNet.SignalR;
|
||||
using Microsoft.Owin.Cors;
|
||||
using Owin;
|
||||
|
||||
namespace WeatherService.SignalR
|
||||
{
|
||||
class Startup
|
||||
{
|
||||
public void Configuration(IAppBuilder app)
|
||||
{
|
||||
app.Map("/signalr", map =>
|
||||
{
|
||||
map.UseCors(CorsOptions.AllowAll);
|
||||
|
||||
var hubConfiguration = new HubConfiguration();
|
||||
map.RunSignalR(hubConfiguration);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
13
SignalR/WeatherHub.cs
Normal file
13
SignalR/WeatherHub.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Microsoft.AspNet.SignalR;
|
||||
using Microsoft.AspNet.SignalR.Hubs;
|
||||
|
||||
namespace WeatherService.SignalR
|
||||
{
|
||||
public class WeatherHub : Hub
|
||||
{
|
||||
public void Send(string message)
|
||||
{
|
||||
Clients.Others.addMessage(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user