基础服务api
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.
 
 

47 lines
1.2 KiB

  1. using BPA.SAAS.Manage.Core;
  2. using Furion;
  3. using Microsoft.AspNetCore.Builder;
  4. using Microsoft.AspNetCore.Hosting;
  5. using Microsoft.Extensions.DependencyInjection;
  6. using Microsoft.Extensions.Hosting;
  7. namespace BPA.SAAS.Manage.Web.Core
  8. {
  9. public class Startup : AppStartup
  10. {
  11. public void ConfigureServices(IServiceCollection services)
  12. {
  13. services.AddConsoleFormatter();
  14. services.AddJwt<JwtHandler>();
  15. services.AddCorsAccessor();
  16. services.AddSqlsugarSetup(App.Configuration);
  17. services.AddControllers()
  18. .AddInjectWithUnifyResult();
  19. }
  20. public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
  21. {
  22. if (env.IsDevelopment())
  23. {
  24. app.UseDeveloperExceptionPage();
  25. }
  26. app.UseHttpsRedirection();
  27. app.UseRouting();
  28. app.UseCorsAccessor();
  29. app.UseAuthentication();
  30. app.UseAuthorization();
  31. app.UseInject(string.Empty);
  32. app.UseEndpoints(endpoints =>
  33. {
  34. endpoints.MapControllers();
  35. });
  36. }
  37. }
  38. }