chore:目录重构
This commit is contained in:
47
Yi.Furion.Net6/Yi.Furion.Web.Core/Startup.cs
Normal file
47
Yi.Furion.Net6/Yi.Furion.Web.Core/Startup.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using Furion;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Yi.Furion.Web.Core.Handlers;
|
||||
|
||||
namespace Yi.Furion.Web.Core;
|
||||
|
||||
public class Startup : AppStartup
|
||||
{
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddConsoleFormatter();
|
||||
services.AddJwt<JwtHandler>();
|
||||
|
||||
services.AddCorsAccessor();
|
||||
|
||||
services.AddControllers().AddInjectWithUnifyResult();
|
||||
|
||||
services.AddEventBus();
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseCorsAccessor();
|
||||
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
app.UseInject(string.Empty);
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user