42 lines
982 B
C#
42 lines
982 B
C#
|
|
var builder = WebApplication.CreateBuilder(args);
|
|||
|
|
|
|||
|
|
var configuration = builder.Configuration;
|
|||
|
|
// Add services to the container.
|
|||
|
|
builder.Services.AddControllersWithViews();
|
|||
|
|
builder.Services.AddRemoteRequest(options =>
|
|||
|
|
{
|
|||
|
|
//<2F><>̩<EFBFBD>˵缫<CBB5>㷨<EFBFBD><E3B7A8>ַ
|
|||
|
|
options.AddHttpClient("hetai", c =>
|
|||
|
|
{
|
|||
|
|
c.BaseAddress = new Uri(configuration["BodyApiSettings:BaseUrl"]);
|
|||
|
|
})
|
|||
|
|
.ConfigurePrimaryHttpMessageHandler(u => new HttpClientHandler
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD> SSL <20><><EFBFBD><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD>飬<EFBFBD><E9A3AC> https <20><><EFBFBD><EFBFBD>ȫ<EFBFBD><C8AB> https ֤<><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
ServerCertificateCustomValidationCallback = (_, _, _, _) => true
|
|||
|
|
})
|
|||
|
|
;
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
var app = builder.Build();
|
|||
|
|
|
|||
|
|
// Configure the HTTP request pipeline.
|
|||
|
|
if (!app.Environment.IsDevelopment())
|
|||
|
|
{
|
|||
|
|
app.UseExceptionHandler("/Home/Error");
|
|||
|
|
app.UseHsts();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
app.UseHttpsRedirection();
|
|||
|
|
app.UseStaticFiles();
|
|||
|
|
|
|||
|
|
app.UseRouting();
|
|||
|
|
|
|||
|
|
app.UseAuthorization();
|
|||
|
|
|
|||
|
|
app.MapControllerRoute(
|
|||
|
|
name: "default",
|
|||
|
|
pattern: "{controller=Home}/{action=Index}/{id?}");
|
|||
|
|
|
|||
|
|
app.Run();
|