Przeglądaj źródła

[WebApplicationSample] UseHttpsRedirection

Roc 3 lat temu
rodzic
commit
f04a281e78

+ 4 - 10
samples/WebApplicationSample/Properties/launchSettings.json

@@ -3,8 +3,8 @@
     "windowsAuthentication": false,
     "anonymousAuthentication": true,
     "iisExpress": {
-      "applicationUrl": "http://localhost:5000/",
-      "sslPort": 0
+      "applicationUrl": "http://localhost:38327",
+      "sslPort": 44310
     }
   },
   "profiles": {
@@ -18,16 +18,10 @@
     "WebApplicationSample": {
       "commandName": "Project",
       "launchBrowser": true,
+      "applicationUrl": "https://localhost:5000;http://localhost:5001",
       "environmentVariables": {
         "ASPNETCORE_ENVIRONMENT": "Development"
-      },
-      "applicationUrl": "http://localhost:5000/"
-    },
-    "Docker": {
-      "commandName": "Docker",
-      "launchBrowser": true,
-      "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
-      "publishAllPorts": true
+      }
     }
   }
 }

+ 3 - 0
samples/WebApplicationSample/Startup.cs

@@ -42,6 +42,9 @@ namespace WebApplicationSample
             {
                 app.UseExceptionHandler("/Home/Error");
             }
+
+            app.UseHttpsRedirection();
+
             app.UseStaticFiles();
 
             app.UseRouting();