mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-14 01:25:38 -05:00
32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
using ChrisKaczor.HomeMonitor.Hub.Service.Hubs;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
namespace ChrisKaczor.HomeMonitor.Hub.Service
|
|
{
|
|
public class Startup
|
|
{
|
|
public void ConfigureServices(IServiceCollection services)
|
|
{
|
|
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
|
|
|
|
services.AddSignalR().AddJsonProtocol(options => { options.PayloadSerializerOptions.WriteIndented = false; });
|
|
}
|
|
|
|
public void Configure(IApplicationBuilder applicationBuilder, IWebHostEnvironment environment)
|
|
{
|
|
if (environment.IsDevelopment())
|
|
{
|
|
applicationBuilder.UseDeveloperExceptionPage();
|
|
}
|
|
|
|
applicationBuilder.UseEndpoints(endpoints =>
|
|
{
|
|
endpoints.MapHub<WeatherHub>("/weatherHub");
|
|
});
|
|
}
|
|
}
|
|
} |