feat: serve PWA web app manifest at /manifest.json#466
Open
ilfroloff wants to merge 1 commit into
Open
Conversation
980205f to
64e8607
Compare
- Add src/swingmusic/assets/manifest.json with full PWA manifest content (name, icons, display, theme_color, etc.) as a bundled fallback asset - Add /manifest.json route in app_builder.py that serves from the client build folder when present, falling back to the bundled asset - Exempt /manifest.json from JWT auth check so browsers can fetch it without authentication - Fix load_plugins() indentation (was double-indented at 8 spaces)
64e8607 to
f7de6cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Swing Music already uses VitePWA on the frontend, which generates a
manifest.jsonat build time. However, the Flask backend had no routeto serve that file, so browsers received a 404 when requesting
/manifest.jsondirectly from the production server (port 1970).Without a valid manifest, browsers cannot:
What this PR does
Adds
src/swingmusic/assets/manifest.json– a fully-specifiedPWA Web App Manifest bundled with the server. It is used as a
fallback when a client build is not present.
Adds a
/manifest.jsonroute inapp_builder.pythat:manifest.jsonfrom the client build folder (the filegenerated by VitePWA) when it exists, so the frontend is the
source of truth in production.
(e.g. bare server installs, CI, development without a built
client).
Content-Type: application/manifest+json.Exempts
/manifest.jsonfrom JWT auth so browsers can fetch itbefore the user has logged in (required for install-prompt to fire).
Fixes
load_plugins()indentation – the function body wasindented at 8 spaces (double indent) instead of the standard 4.
Testing
Related
Companion PR in swingmx/webclient configures VitePWA to emit
manifest.json(instead of the defaultmanifest.webmanifest) andremoves the empty
public/site.webmanifestplaceholder.