Small tweaks to make the MVC application run locally
This commit is contained in:
		
							parent
							
								
									50952bed10
								
							
						
					
					
						commit
						06d74d1658
					
				| @ -63,7 +63,7 @@ static void AddHealthChecks(WebApplicationBuilder builder) | |||||||
| { | { | ||||||
|     builder.Services.AddHealthChecks() |     builder.Services.AddHealthChecks() | ||||||
|         .AddCheck("self", () => HealthCheckResult.Healthy()) |         .AddCheck("self", () => HealthCheckResult.Healthy()) | ||||||
|         .AddUrlGroup(new Uri(builder.Configuration["IdentityUrlHC"]), name: "identityapi-check", tags: new string[] { "identityapi" }); |         .AddUrlGroup(_ => new Uri(builder.Configuration["IdentityUrlHC"]), name: "identityapi-check", tags: new string[] { "identityapi" }); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void AddCustomMvc(WebApplicationBuilder builder) | static void AddCustomMvc(WebApplicationBuilder builder) | ||||||
| @ -85,7 +85,7 @@ static void AddCustomMvc(WebApplicationBuilder builder) | |||||||
| // Adds all Http client services | // Adds all Http client services | ||||||
| static void AddHttpClientServices(WebApplicationBuilder builder) | static void AddHttpClientServices(WebApplicationBuilder builder) | ||||||
| { | { | ||||||
|     builder.Services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); |     builder.Services.AddHttpContextAccessor(); | ||||||
| 
 | 
 | ||||||
|     //register delegating handlers |     //register delegating handlers | ||||||
|     builder.Services.AddTransient<HttpClientAuthorizationDelegatingHandler>() |     builder.Services.AddTransient<HttpClientAuthorizationDelegatingHandler>() | ||||||
| @ -116,7 +116,7 @@ static void AddCustomAuthentication(WebApplicationBuilder builder) | |||||||
|     var callBackUrl = builder.Configuration.GetValue<string>("CallBackUrl"); |     var callBackUrl = builder.Configuration.GetValue<string>("CallBackUrl"); | ||||||
|     var sessionCookieLifetime = builder.Configuration.GetValue("SessionCookieLifetimeMinutes", 60); |     var sessionCookieLifetime = builder.Configuration.GetValue("SessionCookieLifetimeMinutes", 60); | ||||||
| 
 | 
 | ||||||
|     // Add Authentication services           |     // Add Authentication services | ||||||
| 
 | 
 | ||||||
|     builder.Services.AddAuthentication(options => |     builder.Services.AddAuthentication(options => | ||||||
|     { |     { | ||||||
|  | |||||||
| @ -1,23 +1,9 @@ | |||||||
| { | { | ||||||
|   "iisSettings": { |  | ||||||
|     "windowsAuthentication": false, |  | ||||||
|     "anonymousAuthentication": true, |  | ||||||
|     "iisExpress": { |  | ||||||
|       "applicationUrl": "http://localhost:5100", |  | ||||||
|       "sslPort": 0 |  | ||||||
|     } |  | ||||||
|   }, |  | ||||||
|   "profiles": { |   "profiles": { | ||||||
|     "IIS Express": { |  | ||||||
|       "commandName": "IISExpress", |  | ||||||
|       "environmentVariables": { |  | ||||||
|         "ASPNETCORE_ENVIRONMENT": "Development" |  | ||||||
|       } |  | ||||||
|     }, |  | ||||||
|     "Microsoft.eShopOnContainers.WebMVC": { |     "Microsoft.eShopOnContainers.WebMVC": { | ||||||
|       "commandName": "Project", |       "commandName": "Project", | ||||||
|       "launchBrowser": true, |       "launchBrowser": true, | ||||||
|       "launchUrl": "http://localhost:5000", |       "applicationUrl": "http://localhost:5331", | ||||||
|       "environmentVariables": { |       "environmentVariables": { | ||||||
|         "ASPNETCORE_ENVIRONMENT": "Development" |         "ASPNETCORE_ENVIRONMENT": "Development" | ||||||
|       } |       } | ||||||
|  | |||||||
| @ -1,8 +1,10 @@ | |||||||
| { | { | ||||||
|   "CatalogUrl": "http://localhost:5101", |   "PurchaseUrl": "http://localhost:5229", | ||||||
|   "OrderingUrl": "http://localhost:5102", |   "CatalogUrl": "http://localhost:5222", | ||||||
|   "BasketUrl": "http://localhost:5103", |   "OrderingUrl": "http://localhost:5224", | ||||||
|   "IdentityUrl": "http://localhost:5105", |   "BasketUrl": "http://localhost:5221", | ||||||
|  |   "IdentityUrl": "http://localhost:5223", | ||||||
|  |   "IdentityUrlHC": "http://localhost:5223/hc", | ||||||
|   "CallBackUrl": "http://localhost:5100/", |   "CallBackUrl": "http://localhost:5100/", | ||||||
|   "IsClusterEnv": "False", |   "IsClusterEnv": "False", | ||||||
|   "UseResilientHttp": "True", |   "UseResilientHttp": "True", | ||||||
|  | |||||||
| @ -1,7 +1,24 @@ | |||||||
| global using HealthChecks.UI.Client; | global using System; | ||||||
|  | global using System.Collections.Generic; | ||||||
|  | global using System.ComponentModel; | ||||||
|  | global using System.ComponentModel.DataAnnotations; | ||||||
|  | global using System.IdentityModel.Tokens.Jwt; | ||||||
|  | global using System.IO; | ||||||
|  | global using System.IO.Compression; | ||||||
|  | global using System.Linq; | ||||||
|  | global using System.Net.Http; | ||||||
|  | global using System.Net.Http.Headers; | ||||||
|  | global using System.Security.Claims; | ||||||
|  | global using System.Security.Principal; | ||||||
|  | global using System.Text; | ||||||
|  | global using System.Text.Json; | ||||||
|  | global using System.Text.Json.Serialization; | ||||||
|  | global using System.Threading; | ||||||
|  | global using System.Threading.Tasks; | ||||||
|  | global using HealthChecks.UI.Client; | ||||||
|  | global using Microsoft.AspNetCore.Authentication; | ||||||
| global using Microsoft.AspNetCore.Authentication.Cookies; | global using Microsoft.AspNetCore.Authentication.Cookies; | ||||||
| global using Microsoft.AspNetCore.Authentication.OpenIdConnect; | global using Microsoft.AspNetCore.Authentication.OpenIdConnect; | ||||||
| global using Microsoft.AspNetCore.Authentication; |  | ||||||
| global using Microsoft.AspNetCore.Authorization; | global using Microsoft.AspNetCore.Authorization; | ||||||
| global using Microsoft.AspNetCore.Builder; | global using Microsoft.AspNetCore.Builder; | ||||||
| global using Microsoft.AspNetCore.DataProtection; | global using Microsoft.AspNetCore.DataProtection; | ||||||
| @ -9,40 +26,21 @@ global using Microsoft.AspNetCore.Diagnostics.HealthChecks; | |||||||
| global using Microsoft.AspNetCore.Hosting; | global using Microsoft.AspNetCore.Hosting; | ||||||
| global using Microsoft.AspNetCore.Http; | global using Microsoft.AspNetCore.Http; | ||||||
| global using Microsoft.AspNetCore.Identity; | global using Microsoft.AspNetCore.Identity; | ||||||
| global using Microsoft.AspNetCore.Mvc.Rendering; |  | ||||||
| global using Microsoft.AspNetCore.Mvc; | global using Microsoft.AspNetCore.Mvc; | ||||||
| global using Microsoft.AspNetCore; | global using Microsoft.AspNetCore.Mvc.Rendering; | ||||||
|  | global using Microsoft.eShopOnContainers.WebMVC; | ||||||
| global using Microsoft.eShopOnContainers.WebMVC.Services; | global using Microsoft.eShopOnContainers.WebMVC.Services; | ||||||
|  | global using Microsoft.eShopOnContainers.WebMVC.ViewModels; | ||||||
| global using Microsoft.eShopOnContainers.WebMVC.ViewModels.Annotations; | global using Microsoft.eShopOnContainers.WebMVC.ViewModels.Annotations; | ||||||
| global using Microsoft.eShopOnContainers.WebMVC.ViewModels.CartViewModels; | global using Microsoft.eShopOnContainers.WebMVC.ViewModels.CartViewModels; | ||||||
| global using Microsoft.eShopOnContainers.WebMVC.ViewModels.CatalogViewModels; | global using Microsoft.eShopOnContainers.WebMVC.ViewModels.CatalogViewModels; | ||||||
| global using Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination; | global using Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination; | ||||||
| global using Microsoft.eShopOnContainers.WebMVC.ViewModels; |  | ||||||
| global using Microsoft.eShopOnContainers.WebMVC; |  | ||||||
| global using Microsoft.Extensions.Configuration; | global using Microsoft.Extensions.Configuration; | ||||||
| global using Microsoft.Extensions.DependencyInjection; | global using Microsoft.Extensions.DependencyInjection; | ||||||
| global using Microsoft.Extensions.Diagnostics.HealthChecks; | global using Microsoft.Extensions.Diagnostics.HealthChecks; | ||||||
| global using Microsoft.Extensions.Hosting; | global using Microsoft.Extensions.Hosting; | ||||||
| global using Microsoft.Extensions.Logging; | global using Microsoft.Extensions.Logging; | ||||||
| global using Microsoft.Extensions.Options; | global using Microsoft.Extensions.Options; | ||||||
| global using Microsoft.IdentityModel.Logging; |  | ||||||
| global using StackExchange.Redis; | global using StackExchange.Redis; | ||||||
| global using System.Collections.Generic; |  | ||||||
| global using System.ComponentModel.DataAnnotations; |  | ||||||
| global using System.ComponentModel; |  | ||||||
| global using System.IdentityModel.Tokens.Jwt; |  | ||||||
| global using System.IO.Compression; |  | ||||||
| global using System.IO; |  | ||||||
| global using System.Linq; |  | ||||||
| global using System.Net.Http.Headers; |  | ||||||
| global using System.Net.Http; |  | ||||||
| global using System.Security.Claims; |  | ||||||
| global using System.Security.Principal; |  | ||||||
| global using System.Text.Json.Serialization; |  | ||||||
| global using System.Text.Json; |  | ||||||
| global using System.Text; |  | ||||||
| global using System.Threading.Tasks; |  | ||||||
| global using System.Threading; |  | ||||||
| global using System; |  | ||||||
| global using WebMVC.Infrastructure; | global using WebMVC.Infrastructure; | ||||||
| global using WebMVC.Services.ModelDTOs; | global using WebMVC.Services.ModelDTOs; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user