adding development time static files proxying#2207
Conversation
829a68f to
73a891f
Compare
There was a problem hiding this comment.
Pull Request Overview
This pull request adds support for static file proxying in development environments while maintaining CDN support for production. The main change introduces a new StaticAssetsUrl property to BffFrontend that allows proxying all static assets (JS, CSS, images) through the BFF server, which is particularly useful for development scenarios with hot-reloading dev servers.
- Replaces
IndexHtmlUrlwithCdnIndexHtmlUrland addsStaticAssetsUrlfor full asset proxying - Implements mutual exclusion between CDN and proxying modes to prevent configuration conflicts
- Adds extension methods to dynamically choose between CDN and proxying based on environment
Reviewed Changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
BffFrontend.cs |
Core model changes adding StaticAssetsUrl and CdnIndexHtmlUrl with mutual exclusion logic |
StaticFilesHttpClient.cs |
New implementation replacing IndexHtmlHttpClient with static asset proxying capabilities |
ProxyStaticFilesMiddleware.cs |
Updated middleware to handle both index HTML and static asset proxying |
BffFrontendExtensions.cs |
New extension methods for configuring static assets with environment-based switching |
| Test files | Updated tests to use new property names and test static asset proxying functionality |
| Host projects | Example configurations showing development vs production usage patterns |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 29 out of 30 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2c8a53d to
fd1444a
Compare
fd1444a to
fb47c6c
Compare
…imeout test a bit more stable
cc24633 to
c3b9f5c
Compare
What issue does this PR address?
Right now, the BFF allows you to proxy an index html document. This works great in production, but not so great during development.
Suggestion:
Add a proxying method that proxies all static assets, including web sockets. This works great for development. Then provide an easy method for switching.
fixes https://github.com/DuendeSoftware/products-private/issues/2265
Important: Any code or remarks in your Pull Request are under the following terms:
If You provide us with any comments, bug reports, feedback, enhancements, or modifications proposed or suggested by You for the Software, such Feedback is provided on a non-confidential basis (notwithstanding any notice to the contrary You may include in any accompanying communication), and Licensor shall have the right to use such Feedback at its discretion, including, but not limited to the incorporation of such suggested changes into the Software. You hereby grant Licensor a perpetual, irrevocable, transferable, sublicensable, nonexclusive license under all rights necessary to incorporate and use your Feedback for any purpose, including to make and sell any products and services.
(see our license, section 7)