Sources/Api/Startup.cs
/// <summary>
/// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
/// </summary>
/// <param name="app">application builder object</param>
/// <param name="env">hosting environment</param>
This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
This method gets called by the runtime . Use this method to configure the HTTP request pipeline .
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }
            List<CultureInfo> supportedCultures = new List<CultureInfo>
            {
                new CultureInfo("en-US"),
                new CultureInfo("fr")
            };
            app.UseRequestLocalization(new RequestLocalizationOptions
            {
                DefaultRequestCulture = new RequestCulture("en-US"),
                SupportedCultures = supportedCultures,
                SupportedUICultures = supportedCultures,
                RequestCultureProviders = new List<IRequestCultureProvider>
                {
                    new AcceptLanguageHeaderRequestCultureProvider()
                }
            });
            app.UseAuthentication();
            app.UseMvc();
            app.UseHttpsRedirection();
            app.UseCors(x => x
                .AllowAnyOrigin()
                .AllowAnyMethod()
                .AllowAnyHeader());
        }
public void Configure ( IApplicationBuilder app , IHostingEnvironment env ) { if ( env . IsDevelopment ( ) ) { app . UseDeveloperExceptionPage ( ) ; } else { app . UseHsts ( ) ; } List < CultureInfo > supportedCultures = new List < CultureInfo > { new CultureInfo ( " " ) , new CultureInfo ( " " ) } ; app . UseRequestLocalization ( new RequestLocalizationOptions { DefaultRequestCulture = new RequestCulture ( " " ) , SupportedCultures = supportedCultures , SupportedUICultures = supportedCultures , RequestCultureProviders = new List < IRequestCultureProvider > { new AcceptLanguageHeaderRequestCultureProvider ( ) } } ) ; app . UseAuthentication ( ) ; app . UseMvc ( ) ; app . UseHttpsRedirection ( ) ; app . UseCors ( x => x . AllowAnyOrigin ( ) . AllowAnyMethod ( ) . AllowAnyHeader ( ) ) ; }
This method gets called by the runtime.
This method gets called by the runtime .
// global cors policy
app
IApplicationBuilder
application builder object
application builder object
env
IHostingEnvironment
None