Skip to content

Commit

Permalink
MapStaticAssets
Browse files Browse the repository at this point in the history
  • Loading branch information
PieterjanDeClippel committed Nov 13, 2024
1 parent c0b7e14 commit c811a34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Demo/Prerendering/Demo.Web/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
}

app.UseHttpsRedirection();
app.UseStaticFiles();
if (!env.IsDevelopment())
{
app.UseSpaStaticFilesImproved();
Expand All @@ -91,6 +90,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

app.UseEndpoints(endpoints =>
{
endpoints.MapStaticAssets();
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller}/{action=Index}/{id?}");
Expand All @@ -109,7 +109,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
spa.UseSpaPrerendering(options =>
{
options.BootModulePath = $"{spa.Options.SourcePath}/dist/ClientApp/server/main.js";
//options.BootModuleBuilder = env.IsDevelopment() ? new AngularPrerendererBuilder("build:ssr:development", @"Build at\:", 1) : null;
options.BootModuleBuilder = env.IsDevelopment() ? new AngularPrerendererBuilder("build:ssr:development", @"Build at\:", 1) : null;
options.ExcludeUrls = new[] { "/sockjs-node" };

options.OnPrepareResponse = (context) =>
Expand Down
2 changes: 1 addition & 1 deletion Demo/Xsrf/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
app.UseHttpsRedirection();
app.UseAntiforgery();

app.UseStaticFiles();
if (!env.IsDevelopment())
{
app.UseSpaStaticFilesImproved();
Expand All @@ -50,6 +49,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

app.UseEndpoints(endpoints =>
{
endpoints.MapStaticAssets();
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller}/{action=Index}/{id?}");
Expand Down

0 comments on commit c811a34

Please sign in to comment.