Startup.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Microsoft.AspNetCore.Builder;
  2. using Microsoft.AspNetCore.Hosting;
  3. using Microsoft.Extensions.Configuration;
  4. using Microsoft.Extensions.DependencyInjection;
  5. using Microsoft.Extensions.Hosting;
  6. namespace sera_slackbot
  7. {
  8. public class Startup
  9. {
  10. public Startup(IConfiguration configuration)
  11. {
  12. Configuration = configuration;
  13. }
  14. public IConfiguration Configuration { get; }
  15. // This method gets called by the runtime. Use this method to add services to the container.
  16. public void ConfigureServices(IServiceCollection services)
  17. {
  18. services.AddControllers();
  19. }
  20. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
  21. public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
  22. {
  23. if (env.IsDevelopment())
  24. {
  25. app.UseDeveloperExceptionPage();
  26. }
  27. app.UseRouting();
  28. app.UseEndpoints(endpoints =>
  29. {
  30. endpoints.MapControllers();
  31. });
  32. Library.GlobalConfiguration.Set(Configuration);
  33. }
  34. }
  35. }