1- var appName = "Ordering.API " ;
1+ var appName = "Web.Shopping.HttpAggregator " ;
22var builder = WebApplication . CreateBuilder ( args ) ;
3- builder . WebHost . ConfigureAppConfiguration ( cb =>
4- {
5- var sources = cb . Sources ;
6- sources . Insert ( 3 , new Microsoft . Extensions . Configuration . Json . JsonConfigurationSource ( )
7- {
8- Optional = true ,
9- Path = "appsettings.localhost.json" ,
10- ReloadOnChange = false
11- } ) ;
12- } ) ;
3+
134builder . Host . UseSerilog ( CreateSerilogLogger ( builder . Configuration ) ) ;
145builder . Services . AddHealthChecks ( )
156 . AddCheck ( "self" , ( ) => HealthCheckResult . Healthy ( ) )
2011 . AddUrlGroup ( new Uri ( builder . Configuration [ "PaymentUrlHC" ] ) , name : "paymentapi-check" , tags : new string [ ] { "paymentapi" } ) ;
2112builder . Services . AddCustomMvc ( builder . Configuration )
2213 . AddCustomAuthentication ( builder . Configuration )
23- //.AddCustomAuthorization(Configuration)
2414 . AddApplicationServices ( )
2515 . AddGrpcServices ( ) ;
2616var app = builder . Build ( ) ;
@@ -93,8 +83,6 @@ Serilog.ILogger CreateSerilogLogger(IConfiguration configuration)
9383 . Enrich . WithProperty ( "ApplicationContext" , Program . AppName )
9484 . Enrich . FromLogContext ( )
9585 . WriteTo . Console ( )
96- //.WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl)
97- //.WriteTo.Http(string.IsNullOrWhiteSpace(logstashUrl) ? "http://logstash:8080" : logstashUrl, null)
9886 . ReadFrom . Configuration ( configuration )
9987 . CreateLogger ( ) ;
10088}
@@ -136,15 +124,12 @@ public static IServiceCollection AddCustomMvc(this IServiceCollection services,
136124
137125 services . AddSwaggerGen ( options =>
138126 {
139- //options.DescribeAllEnumsAsStrings();
140-
141127 options . SwaggerDoc ( "v1" , new OpenApiInfo
142128 {
143129 Title = "Shopping Aggregator for Web Clients" ,
144130 Version = "v1" ,
145131 Description = "Shopping Aggregator for Web Clients"
146132 } ) ;
147-
148133 options . AddSecurityDefinition ( "oauth2" , new OpenApiSecurityScheme
149134 {
150135 Type = SecuritySchemeType . OAuth2 ,
@@ -154,7 +139,6 @@ public static IServiceCollection AddCustomMvc(this IServiceCollection services,
154139 {
155140 AuthorizationUrl = new Uri ( $ "{ configuration . GetValue < string > ( "IdentityUrlExternal" ) } /connect/authorize") ,
156141 TokenUrl = new Uri ( $ "{ configuration . GetValue < string > ( "IdentityUrlExternal" ) } /connect/token") ,
157-
158142 Scopes = new Dictionary < string , string > ( )
159143 {
160144 { "webshoppingagg" , "Shopping Aggregator for Web Clients" }
@@ -165,7 +149,6 @@ public static IServiceCollection AddCustomMvc(this IServiceCollection services,
165149
166150 options . OperationFilter < AuthorizeCheckOperationFilter > ( ) ;
167151 } ) ;
168-
169152 services . AddCors ( options =>
170153 {
171154 options . AddPolicy ( "CorsPolicy" ,
0 commit comments