Skip to content

Commit

Permalink
Switching over to using SSL in Visual Studio (when IIS Express is used)
Browse files Browse the repository at this point in the history
  • Loading branch information
gorohoroh committed Jul 14, 2018
1 parent d1e4e4a commit 67fb3ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:54448/",
"sslPort": 0
"applicationUrl": "https://localhost:44376/",
"sslPort": 44376
}
},
"profiles": {
Expand All @@ -24,4 +24,4 @@
"applicationUrl": "http://localhost:54449/"
}
}
}
}
3 changes: 3 additions & 0 deletions OdeToFoodVisualStudio/OdeToFoodVisualStudio/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Rewrite;
using Microsoft.AspNetCore.Routing;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
Expand Down Expand Up @@ -41,6 +42,8 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, IGreeter
app.UseDeveloperExceptionPage();
}

// RDVS: RewriteOptions suggested as FQN in Visual Studio's completion: Scott had to erase the FQN part and import namespace with a quick action
app.UseRewriter(new RewriteOptions().AddRedirectToHttpsPermanent());
app.UseStaticFiles();
app.UseMvc(ConfigureRoutes);

Expand Down

0 comments on commit 67fb3ec

Please sign in to comment.