diff options
Diffstat (limited to 'spec/fixtures/dotnet/nuget-sln/src/web/Startup.cs')
| -rw-r--r-- | spec/fixtures/dotnet/nuget-sln/src/web/Startup.cs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/spec/fixtures/dotnet/nuget-sln/src/web/Startup.cs b/spec/fixtures/dotnet/nuget-sln/src/web/Startup.cs new file mode 100644 index 0000000..26facf4 --- /dev/null +++ b/spec/fixtures/dotnet/nuget-sln/src/web/Startup.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.HttpsPolicy; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace web +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + public void ConfigureServices(IServiceCollection services) + { + services.AddControllersWithViews(); + } + + 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.UseAuthorization(); + app.UseEndpoints(endpoints => { + endpoints.MapControllerRoute(name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); + }); + } + } +} |
