fixes the catalog page

This commit is contained in:
2024-03-11 01:02:11 +00:00
parent d6180aa154
commit 8656bce151
9 changed files with 30 additions and 24 deletions

View File

@ -5,6 +5,7 @@ using isn;
using isnd.Data;
using isnd.Entities;
using isnd.Interfaces;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.Server;
@ -46,32 +47,27 @@ namespace isnd.tests
public void SetupHost()
{
var webhostBuilder = new WebHostBuilder()
.UseKestrel()
.UseIISIntegration()
var builder = WebHost.CreateDefaultBuilder(new string[0]);
// .UseContentRoot("../../../../../src/isnd")
.UseStartup(typeof(Startup))
builder.UseStartup(typeof(Startup))
.ConfigureAppConfiguration((builderContext, config) =>
{
config.AddJsonFile("appsettings.json", false);
config.AddJsonFile("appsettings.json", true);
config.AddJsonFile("appsettings.Development.json", false);
});
Host = webhostBuilder.Build();
Host = builder.Build();
var logFactory = Host.Services.GetRequiredService<ILoggerFactory>();
Logger = logFactory.CreateLogger<WebServerFixture>();
Host.Start(); //Starts listening on the configured addresses.
var server = Host.Services.GetRequiredService<IServer>();
var addressFeature = server.Features.Get<IServerAddressesFeature>();
var addressFeatures = server.Features.Get<IServerAddressesFeature>();
foreach (var address in addressFeature.Addresses)
foreach (var address in addressFeatures.Addresses)
{
Addresses.Add(address);
}