标签:配置 video lap app rom blog ica src startup
1. 视频 https://www.bilibili.com/video/av33344382/?p=2
using System; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; namespace BlogDemo.Api { public class StartupProduction { public void ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddHttpsRedirection(options => { options.RedirectStatusCode = StatusCodes.Status307TemporaryRedirect; options.HttpsPort = 5001; }); services.AddHsts(options => { options.Preload = true; options.IncludeSubDomains = true; options.MaxAge = TimeSpan.FromDays(60); options.ExcludedHosts.Add("example.com"); options.ExcludedHosts.Add("www.example.com"); }); } public void Configure(IApplicationBuilder app) { app.UseHsts(); app.UseHttpsRedirection(); app.UseMvc(); } } }
标签:配置 video lap app rom blog ica src startup
原文地址:https://www.cnblogs.com/Ken-Cai/p/10344808.html