Skip to content

Commit

Permalink
Remove Startup class from Blazor.Host
Browse files Browse the repository at this point in the history
  • Loading branch information
canro91 committed Sep 5, 2024
1 parent c2a8845 commit 6470604
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 74 deletions.
50 changes: 34 additions & 16 deletions FrontDesk/src/FrontDesk.Blazor.Host/Program.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace FrontDesk.Blazor.Host
var builder = WebApplication.CreateBuilder(args);

builder.Services.AddServerSideBlazor();
builder.Services.AddControllersWithViews();
builder.Services.AddRazorPages();

var app = builder.Build();

app.UsePathBase("/");

if (app.Environment.IsDevelopment())
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}

public static IHostBuilder CreateHostBuilder(string[] args) =>
Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
app.UseDeveloperExceptionPage();
app.UseWebAssemblyDebugging();
}
else
{
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();
}

//app.UseHttpsRedirection();
app.UseBlazorFrameworkFiles();
app.UseStaticFiles();

app.UseRouting();
app.MapRazorPages();
app.MapControllers();
app.MapBlazorHub();
app.MapFallbackToFile("index.html");

app.Run();
58 changes: 0 additions & 58 deletions FrontDesk/src/FrontDesk.Blazor.Host/Startup.cs

This file was deleted.

0 comments on commit 6470604

Please sign in to comment.