dotnet / dotnet/aspnetcore

SpaProxyMiddleware Launch Page

Open
#54,006 0 comments 0 reactions 0 assignees View on GitHub
area-mvc
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

I am trying to create a custom spa launch page, but the SpaProxyMiddleware doesn't allow for it. The middleware is using a privately generated html string, and doesn't provide a way to override.

### Describe the solution you'd like

Given that the 'GenerateSpaLaunchPage' method takes a parameter for 'SpaDevelopmentServerOptions', surely it would be easy enough to allow an option for our own custom html string, and not get stuck with a launch page that doesn't match the existing site at all.

Perhaps something like:
```cs
await writer.WriteAsync(_options.Value.LaunchHtml ?? GenerateSpaLaunchPage(_options.Value));
```

### Additional context

https://github.com/dotnet/aspnetcore/blob/main/src/Middleware/Spa/SpaProxy/src/SpaProxyMiddleware.cs line 63

![SpaProxyMiddleware](https://github.com/dotnet/aspnetcore/assets/100529842/70faff05-eac5-4cb1-bb94-311aaf51c65d)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.