Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moonfire cannot serve all static files present #47

Closed
dolfs opened this issue Mar 10, 2018 · 2 comments
Closed

Moonfire cannot serve all static files present #47

dolfs opened this issue Mar 10, 2018 · 2 comments

Comments

@dolfs
Copy link
Contributor

dolfs commented Mar 10, 2018

NOTE: This is sideways related to #25

I was doing some UI development and an attempt at producing an optimized bundle produces source maps in files separate from the bundle itself:

nvr.bundle.js
nvr.bundle.js.gz
nvr.bundle.js.map

#25 mentions the inability to serve the .gz version of the bundle when gzip is offered as acceptable. This would be a little special code in lieu of on-the-fly gzipping.

The issue addressed here is that therein bundle (nvr.bundle.js) attempts to load the source map in a separate request. The request fails with a 404 status. It seems Moonfire filters available static files, possibly by extension? May be not a good idea.

If a request in a url matches an existing file, it should probably be served up, but I can see how a complication would be to have a mapping of extensions to mime types. Perhaps it is as simple, at least for this case, to add something for .map.

@scottlamb
Copy link
Owner

Yes, currently it has a simple mapping from extension to MIME type, and it skips extensions it doesn't know about. You can see the code in fill_ui_files in src/web.rs. What MIME type should .map use?

@dolfs
Copy link
Contributor Author

dolfs commented Mar 10, 2018 via email

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

No branches or pull requests

2 participants