Fix: Resolve 301 redirects and 404 errors when serving HTML files #50
+4
−1
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.
Problem
The
pnpm run servecommand was returning 301 redirects followed by 404 errors when accessing HTML files liketodo-2d2b.html. This happened because theservepackage'scleanUrlsfeature automatically redirectsfilename.htmltofilename(removing the extension), but the actual files have.htmlextensions.Using it in MacOS (15.7.1 (24G231)).
Solution
assets/serve.jsonconfiguration file with{"cleanUrls": false}to disable automatic HTML extension removalpackage.jsonto use the configuration fileChanges
assets/serve.json- disables cleanUrls featurepackage.json- updated serve command to reference the config fileResult
200 OKinstead of301 → 404http://localhost:4444/todo-2d2b.htmlworks correctlyThis fix ensures that the static file server works as expected when serving the built widget assets for the MCP servers.