feat:第一次提交
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
|
||||
using Furion;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using NapCatRobotClient.Core.Helper;
|
||||
using System.Net;
|
||||
|
||||
namespace NapCatRobotClient.API
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var builder = WebApplication.CreateBuilder(args).Inject();
|
||||
builder.WebHost.UseUrls(App.Configuration["AppSettings:Urls"]);
|
||||
|
||||
builder.Services.AddRedis(App.Configuration["ConnectionStrings:Redis"]);
|
||||
builder.Services.AddControllers();
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseInject(string.Empty);
|
||||
|
||||
app.EnableBuffering();
|
||||
|
||||
app.UseForwardedHeaders(new ForwardedHeadersOptions
|
||||
{
|
||||
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto,
|
||||
KnownProxies = { IPAddress.Parse("127.0.0.1") }
|
||||
});
|
||||
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user