Questions tagged «httpsys»

1
如何在使用Http.sys和URLPrefix时配置dotnet core 3来提供React SPA?
更改URLPrefix后,出现以下错误: SPA默认页面中间件无法返回默认页面'/index.html',因为找不到默认页面,并且没有其他中间件处理该请求。 因此,需要一些信息来告诉dotnet core有关前缀的信息,但是我似乎找不到正确的设置组合。 帮助非常感谢。 代码如下: HostBuilder的设置: public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseHttpSys(options => { options.AllowSynchronousIO = false; options.Authentication.Schemes = AuthenticationSchemes.None; options.Authentication.AllowAnonymous = true; options.MaxConnections = null; options.MaxRequestBodySize = 30000000; options.UrlPrefixes.Add("http://localhost:5005/Product/Site"); }); webBuilder.UseStartup<Startup>(); }); ConfigureServices: public override void ConfigureServices(IServiceCollection services) { services.AddRazorPages(); services.AddSpaStaticFiles(configuration => { …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.