Skip to content

Commit 354de47

Browse files
committed
Установка contentroot не работала
1 parent 9a65f37 commit 354de47

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/OneScript.Web.Server/WebServer.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,18 @@ public void Run()
7777

7878
private void ConfigureApp()
7979
{
80-
var builder = WebApplication.CreateBuilder();
80+
var appOptions = new WebApplicationOptions
81+
{
82+
ContentRootPath = _contentRoot ?? "."
83+
};
84+
85+
var builder = WebApplication.CreateBuilder(appOptions);
8186
builder.WebHost.ConfigureKestrel(options =>
8287
{
8388
options.AllowSynchronousIO = true;
8489
options.ListenAnyIP(Port);
8590
});
8691

87-
if (_contentRoot != null)
88-
builder.WebHost.UseContentRoot(_contentRoot);
89-
9092
_app = builder.Build();
9193

9294
if (_useStaticFiles)

0 commit comments

Comments
 (0)