// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(
            IApplicationBuilder app,
            IHostingEnvironment env,
            IOptions <EnvironmentSettings> environmentSettings,
            IOptions <EndPointCollectionSettings> endPointCollectionSettings
            )
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            app.UseStaticFiles();
            app.UseHttpsRedirection();
            app.UseMvcWithDefaultRoute();

            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.DocumentTitle = "AG API";
                c.SwaggerEndpoint(environmentSettings.Value.SwaggerPath, "AG.com API V1");
                c.OAuthClientId("AG.com-privacy");
                c.OAuthAppName("AG.com-privacy");
            });

            app.UseAuthentication();
            //app.UseAuthorization();

            DependencyInjectionBootstraper.InitializeServices(app.ApplicationServices);
        }
예제 #2
0
        // 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
            {
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseMvc();

            DependencyInjectionBootstraper.InitializeServices(app.ApplicationServices);
        }