From dd9be3d18cdfb7870ce522d1c58ddc574cccaadc Mon Sep 17 00:00:00 2001 From: David Fowler Date: Fri, 20 Sep 2019 12:56:00 -0700 Subject: [PATCH] Made fixes to demo --- SignalR30SensorClient/Program.cs | 2 +- .../Properties/launchSettings.json | 27 +++++++++++++++++++ SignalR30SensorWebApplication/Startup.cs | 3 +-- .../appsettings.Development.json | 2 +- 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 SignalR30SensorWebApplication/Properties/launchSettings.json diff --git a/SignalR30SensorClient/Program.cs b/SignalR30SensorClient/Program.cs index 2a050f3..54a43b1 100644 --- a/SignalR30SensorClient/Program.cs +++ b/SignalR30SensorClient/Program.cs @@ -15,7 +15,7 @@ static async Task Main(string[] args) await using var hubConnection = hubConnectionBuilder.Build(); await hubConnection.StartAsync(); - await hubConnection.SendAsync("PublishSensorData", args[0], GenerateSensorData()); + await hubConnection.SendAsync("PublishSensorData", args.Length == 0 ? "x" : args[0], GenerateSensorData()); Console.ReadLine(); } diff --git a/SignalR30SensorWebApplication/Properties/launchSettings.json b/SignalR30SensorWebApplication/Properties/launchSettings.json new file mode 100644 index 0000000..70603ea --- /dev/null +++ b/SignalR30SensorWebApplication/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:60977/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "SignalR30SensorWebApplication": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:5000/;https://localhost:5001" + } + } +} \ No newline at end of file diff --git a/SignalR30SensorWebApplication/Startup.cs b/SignalR30SensorWebApplication/Startup.cs index 22cd248..b0c2881 100644 --- a/SignalR30SensorWebApplication/Startup.cs +++ b/SignalR30SensorWebApplication/Startup.cs @@ -28,8 +28,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDeveloperExceptionPage(); } - app.UseDefaultFiles(); - app.UseStaticFiles(); + app.UseFileServer(); app.UseRouting(); diff --git a/SignalR30SensorWebApplication/appsettings.Development.json b/SignalR30SensorWebApplication/appsettings.Development.json index d61bc2b..e203e94 100644 --- a/SignalR30SensorWebApplication/appsettings.Development.json +++ b/SignalR30SensorWebApplication/appsettings.Development.json @@ -3,7 +3,7 @@ "LogLevel": { "Default": "Debug", "System": "Information", - "Microsoft": "Debug" + "Microsoft": "Information" } } }