Skip to content

Conversation

@escudero89
Copy link

@escudero89 escudero89 commented Oct 15, 2025

Problem

The pnpm run serve command was returning 301 redirects followed by 404 errors when accessing HTML files like todo-2d2b.html. This happened because the serve package's cleanUrls feature automatically redirects filename.html to filename (removing the extension), but the actual files have .html extensions.

Using it in MacOS (15.7.1 (24G231)).

Solution

  • Added assets/serve.json configuration file with {"cleanUrls": false} to disable automatic HTML extension removal
  • Updated the serve command in package.json to use the configuration file

Changes

  • Added: assets/serve.json - disables cleanUrls feature
  • Modified: package.json - updated serve command to reference the config file

Result

  • ✅ HTML files now return 200 OK instead of 301 → 404
  • ✅ Direct access to files like http://localhost:4444/todo-2d2b.html works correctly
  • ✅ No breaking changes to existing functionality

This fix ensures that the static file server works as expected when serving the built widget assets for the MCP servers.

@escudero89 escudero89 changed the title Fix "serve" command with static files Fix: Resolve 301 redirects and 404 errors when serving HTML files Oct 15, 2025
@escudero89 escudero89 marked this pull request as ready for review October 15, 2025 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant