using Facility.AspNetCore; using Facility.Core.Http; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.DependencyInjection; using OapApi.v1.Client; using OapApi.v1.Client.Http; namespace OapApi.v1 { public class Startup : OrchardCore.Modules.StartupBase { public override void ConfigureServices(IServiceCollection services) { services.AddScoped(); services.AddScoped(sp => { return new OapApiV1HttpHandler( sp.GetRequiredService(), new ServiceHttpHandlerSettings { RootPath = "/oap/api/v1", }); }); } public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider) { builder.UseFacilityExceptionHandler(); builder.UseFacilityHttpHandler(); } } }