Revert "Remove some dead code in Blazor hosting"
This reverts commit d8b1af39f0.
This wasn't dead-code after all. Removing this code breaks the
Components functional tests (at least running locally).
This commit is contained in:
parent
38e18ff183
commit
69a7037480
|
|
@ -168,7 +168,19 @@ namespace Microsoft.AspNetCore.Builder
|
||||||
throw new ArgumentNullException(nameof(filePath));
|
throw new ArgumentNullException(nameof(filePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var config = BlazorConfig.Read(clientAssemblyFilePath);
|
||||||
|
|
||||||
|
// We want to serve "index.html" from whichever directory contains it in this priority order:
|
||||||
|
// 1. Client app "dist" directory
|
||||||
|
// 2. Client app "wwwroot" directory
|
||||||
|
// 3. Server app "wwwroot" directory
|
||||||
var directory = endpoints.ServiceProvider.GetRequiredService<IWebHostEnvironment>().WebRootPath;
|
var directory = endpoints.ServiceProvider.GetRequiredService<IWebHostEnvironment>().WebRootPath;
|
||||||
|
var indexHtml = config.FindIndexHtmlFile();
|
||||||
|
if (indexHtml != null)
|
||||||
|
{
|
||||||
|
directory = Path.GetDirectoryName(indexHtml);
|
||||||
|
}
|
||||||
|
|
||||||
var options = new StaticFileOptions()
|
var options = new StaticFileOptions()
|
||||||
{
|
{
|
||||||
FileProvider = new PhysicalFileProvider(directory),
|
FileProvider = new PhysicalFileProvider(directory),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue