Skip to content

Commit 17faebf

Browse files
committed
remove mvc routing spa
1 parent aee00cf commit 17faebf

4 files changed

Lines changed: 8 additions & 28 deletions

File tree

src/Services/Marketing/Marketing.FunctionalTests/CampaignScenarios.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace Marketing.FunctionalTests
1111
{
12+
[Collection("Sequential")]
1213
public class CampaignScenarios
1314
: CampaignScenarioBase
1415
{

src/Services/Marketing/Marketing.FunctionalTests/MarketingScenarioBase.cs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,9 @@ public class MarketingScenarioBase
2020

2121
public TestServer CreateServer()
2222
{
23-
24-
Console.WriteLine(" Creating test server");
2523
var path = Assembly.GetAssembly(typeof(MarketingScenarioBase))
2624
.Location;
2725

28-
Console.WriteLine(" Creating builder");
29-
3026
var hostBuilder = new WebHostBuilder()
3127
.UseContentRoot(Path.GetDirectoryName(path))
3228
.ConfigureAppConfiguration(cb =>
@@ -36,38 +32,28 @@ public TestServer CreateServer()
3632
})
3733
.CaptureStartupErrors(true)
3834
.UseStartup<MarketingTestsStartup>();
39-
40-
Console.WriteLine(" Created builder");
4135

4236
var testServer = new TestServer(hostBuilder);
4337

44-
using (var scope = testServer.Services.CreateScope())
38+
using (var scope = testServer.Services.CreateScope())
4539
{
4640
var services = scope.ServiceProvider;
4741

4842
var logger = services.GetRequiredService<ILogger<MarketingScenarioBase>>();
4943
var settings = services.GetRequiredService<IOptions<MarketingSettings>>();
5044
logger.LogError("connectionString " + settings.Value.ConnectionString);
51-
Console.WriteLine("connectionString " + settings.Value.ConnectionString);
5245
}
5346

5447
testServer.Host
55-
.RemoveDbContext<MarketingContext>()
5648
.MigrateDbContext<MarketingContext>((context, services) =>
5749
{
5850
var logger = services.GetService<ILogger<MarketingContextSeed>>();
5951

60-
logger.LogError("Migrating MarketingContextSeed");
52+
logger.LogError("Migrating MarketingContextSeed");
6153
new MarketingContextSeed()
6254
.SeedAsync(context, logger)
6355
.Wait();
64-
6556
});
66-
Console.WriteLine(" Thread to sleep");
67-
68-
Thread.Sleep(5000);
69-
Console.WriteLine(" Thread after");
70-
7157

7258
return testServer;
7359
}

src/Services/Marketing/Marketing.FunctionalTests/UserLocationRoleScenarios.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace Marketing.FunctionalTests
1010
{
11+
[Collection("Sequential")]
1112
public class UserLocationRoleScenarios
1213
: UserLocationRoleScenariosBase
1314
{

src/Web/WebSPA/Startup.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using Microsoft.AspNetCore.DataProtection;
66
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
77
using Microsoft.AspNetCore.Hosting;
8-
using Microsoft.AspNetCore.Mvc;
98
using Microsoft.Extensions.Configuration;
109
using Microsoft.Extensions.DependencyInjection;
1110
using Microsoft.Extensions.Diagnostics.HealthChecks;
@@ -26,12 +25,8 @@ public Startup(IConfiguration configuration)
2625

2726
public IConfiguration Configuration { get; }
2827

29-
private IHostingEnvironment _hostingEnv;
30-
31-
public Startup(IHostingEnvironment env)
28+
public Startup()
3229
{
33-
_hostingEnv = env;
34-
3530
var localPath = new Uri(Configuration["ASPNETCORE_URLS"])?.LocalPath ?? "/";
3631
Configuration["BaseUrl"] = localPath;
3732
}
@@ -48,8 +43,6 @@ public void ConfigureServices(IServiceCollection services)
4843
.AddUrlGroup(new Uri(Configuration["MarketingUrlHC"]), name: "marketingapigw-check", tags: new string[] { "marketingapigw" })
4944
.AddUrlGroup(new Uri(Configuration["IdentityUrlHC"]), name: "identityapi-check", tags: new string[] { "identityapi" });
5045

51-
services.AddControllers();
52-
5346
services.Configure<AppSettings>(Configuration);
5447

5548
if (Configuration.GetValue<string>("IsClusterEnv") == bool.TrueString)
@@ -62,16 +55,13 @@ public void ConfigureServices(IServiceCollection services)
6255
}
6356

6457
services.AddAntiforgery(options => options.HeaderName = "X-XSRF-TOKEN");
65-
66-
services.AddMvc()
67-
.SetCompatibilityVersion(CompatibilityVersion.Version_3_0)
58+
services.AddControllers()
6859
.AddJsonOptions(options =>
6960
{
7061
options.JsonSerializerOptions.PropertyNameCaseInsensitive = true;
7162
});
7263
}
7364

74-
7565
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
7666
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IAntiforgery antiforgery)
7767
{
@@ -102,6 +92,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
10292
WebContextSeed.Seed(app, env, loggerFactory);
10393

10494
var pathBase = Configuration["PATH_BASE"];
95+
10596
if (!string.IsNullOrEmpty(pathBase))
10697
{
10798
loggerFactory.CreateLogger<Startup>().LogDebug("Using PATH BASE '{pathBase}'", pathBase);
@@ -127,6 +118,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
127118
app.UseRouting();
128119
app.UseEndpoints(endpoints =>
129120
{
121+
endpoints.MapControllers();
130122
endpoints.MapHealthChecks("/liveness", new HealthCheckOptions
131123
{
132124
Predicate = r => r.Name.Contains("self")

0 commit comments

Comments
 (0)