shopping-cart-blazor-wasm/Server/Program.cs

37 lines
752 B
C#
Raw Permalink Normal View History

2021-11-09 11:44:08 +01:00
using Microsoft.AspNetCore.ResponseCompression;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews();
builder.Services.AddRazorPages();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseWebAssemblyDebugging();
}
else
2020-06-19 10:20:16 +02:00
{
2021-11-09 11:44:08 +01:00
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
2020-06-19 10:20:16 +02:00
}
2021-11-09 11:44:08 +01:00
app.UseHttpsRedirection();
app.UseBlazorFrameworkFiles();
app.UseStaticFiles();
app.UseRouting();
app.MapRazorPages();
app.MapControllers();
app.MapFallbackToFile("index.html");
app.Run();