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.

59 lines
1.7 KiB

2 years ago
  1. using Microsoft.AspNetCore.Builder;
  2. using Microsoft.AspNetCore.Hosting;
  3. using Microsoft.AspNetCore.StaticFiles;
  4. using Microsoft.Extensions.Configuration;
  5. using Microsoft.Extensions.DependencyInjection;
  6. using Microsoft.Extensions.Hosting;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Threading.Tasks;
  11. namespace Origtek_OS
  12. {
  13. public class Startup
  14. {
  15. public Startup(IConfiguration configuration)
  16. {
  17. Configuration = configuration;
  18. }
  19. public IConfiguration Configuration { get; }
  20. // This method gets called by the runtime. Use this method to add services to the container.
  21. public void ConfigureServices(IServiceCollection services)
  22. {
  23. services.AddControllersWithViews();
  24. }
  25. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
  26. public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
  27. {
  28. //var provider = new FileExtensionContentTypeProvider();
  29. //// Add new mappings
  30. //provider.Mappings[".woff"] = "application/font-woff";
  31. //provider.Mappings[".woff2"] = "application/font-woff2";
  32. if (env.IsDevelopment())
  33. {
  34. app.UseDeveloperExceptionPage();
  35. }
  36. else
  37. {
  38. app.UseExceptionHandler("/Home/Error");
  39. }
  40. app.UseStaticFiles();
  41. app.UseRouting();
  42. app.UseAuthorization();
  43. app.UseEndpoints(endpoints =>
  44. {
  45. endpoints.MapControllerRoute(
  46. name: "default",
  47. pattern: "{controller}/{action}/{id?}");
  48. });
  49. }
  50. }
  51. }