You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
52 lines
1.2 KiB
3 years ago
|
using Furion;
|
||
|
using Microsoft.AspNetCore.Builder;
|
||
|
using Microsoft.AspNetCore.Hosting;
|
||
|
using Microsoft.Extensions.DependencyInjection;
|
||
|
using Microsoft.Extensions.Hosting;
|
||
|
|
||
|
namespace Cis.Web.Core;
|
||
|
|
||
|
public class Startup : AppStartup
|
||
|
{
|
||
|
public void ConfigureServices(IServiceCollection services)
|
||
|
{
|
||
|
services.AddJwt<JwtHandler>();
|
||
|
|
||
|
services.AddCorsAccessor();
|
||
|
|
||
|
services.AddControllersWithViews()
|
||
|
.AddInjectWithUnifyResult();
|
||
|
}
|
||
|
|
||
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||
|
{
|
||
|
if (env.IsDevelopment())
|
||
|
{
|
||
|
app.UseDeveloperExceptionPage();
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
app.UseExceptionHandler("/Home/Error");
|
||
|
app.UseHsts();
|
||
|
}
|
||
|
app.UseHttpsRedirection();
|
||
|
app.UseStaticFiles();
|
||
|
|
||
|
app.UseRouting();
|
||
|
|
||
|
app.UseCorsAccessor();
|
||
|
|
||
|
app.UseAuthentication();
|
||
|
app.UseAuthorization();
|
||
|
|
||
|
app.UseInject();
|
||
|
|
||
|
app.UseEndpoints(endpoints =>
|
||
|
{
|
||
|
endpoints.MapControllerRoute(
|
||
|
name: "default",
|
||
|
pattern: "{controller=Home}/{action=Index}/{id?}");
|
||
|
});
|
||
|
}
|
||
|
}
|