fix: 不在代码中绑定url
IIS托管时,代码中指定 Urls 将导致无法启动错误 ```csharp //app.Urls.Clear(); //app.Urls.Add("http://0.0.0.0:6819"); ``` 无代理时使用 .\LocalServer.exe --urls="http://0.0.0.0:6818" 绑定 固定url
This commit is contained in:
parent
8a36def339
commit
4a5bc24579
2 changed files with 8 additions and 5 deletions
|
@ -37,14 +37,16 @@ if (app.Environment.IsDevelopment())
|
|||
app.UseSwaggerUI();
|
||||
}
|
||||
DefaultFilesOptions defops = new DefaultFilesOptions();
|
||||
defops.DefaultFileNames.Clear();
|
||||
|
||||
//defops.DefaultFileNames.Clear();
|
||||
defops.DefaultFileNames.Add("index.html");
|
||||
app.UseDefaultFiles(defops);
|
||||
app.UseStaticFiles();
|
||||
app.UseWebSockets();
|
||||
app.UseAuthorization();
|
||||
app.Urls.Clear();
|
||||
app.Urls.Add("http://0.0.0.0:6818");
|
||||
|
||||
//app.Urls.Clear();
|
||||
//app.Urls.Add("http://0.0.0.0:6818");
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
|
|
|
@ -40,7 +40,8 @@ if (app.Environment.IsDevelopment())
|
|||
app.UseSwaggerUI();
|
||||
}
|
||||
app.UseWebSockets();
|
||||
app.Urls.Clear();
|
||||
app.Urls.Add("http://0.0.0.0:6819");
|
||||
|
||||
//app.Urls.Clear();
|
||||
//app.Urls.Add("http://0.0.0.0:6819");
|
||||
app.MapControllers();
|
||||
app.Run();
|
||||
|
|
Loading…
Reference in a new issue