Skip to content

Commit

Permalink
fixed SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb committed May 6, 2024
1 parent 726b635 commit 48a11b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/DrawTogether/Components/App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</head>

<body>
<Routes/>
<Routes @rendermode="InteractiveServer"/>
<script src="_framework/blazor.web.js"></script>
</body>

Expand Down
8 changes: 3 additions & 5 deletions src/DrawTogether/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Akka.Hosting;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
Expand All @@ -7,17 +6,17 @@
using DrawTogether.Config;
using DrawTogether.Data;
using DrawTogether.Email;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.AspNetCore.ResponseCompression;
using Microsoft.Extensions.DependencyInjection.Extensions;

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();

// If you also want WebAssembly SSR, include this line:
builder.Services.AddServerSideBlazor();

builder.Services.AddCascadingAuthenticationState();
builder.Services.AddScoped<IdentityUserAccessor>();
builder.Services.AddScoped<IdentityRedirectManager>();
Expand Down Expand Up @@ -74,8 +73,8 @@
}

app.UseHttpsRedirection();
app.MapBlazorHub();
app.UseStaticFiles();
app.UseResponseCompression();
app.UseAntiforgery();

app.MapRazorComponents<App>()
Expand All @@ -84,5 +83,4 @@

// Add additional endpoints required by the Identity /Account Razor components.
app.MapAdditionalIdentityEndpoints();

app.Run();

0 comments on commit 48a11b9

Please sign in to comment.