Comments (23)
Just want to chime in that lack of WebAssembly mime is forcing me to look for an alternative local server. http-server has beautifully handled all my needs up to this point and I'd hate to switch if I don't have to.
from http-server.
@paulmelnikow I've been using https://crates.io/crates/https. That page includes installation instructions for non Rust developers as well.
from http-server.
MIME types can be customised in local-web-server, is that the kind of behaviour you're looking for?
from http-server.
In case you landed here to figure out how to use the --mimetypes
command line option and the syntax of its file, see here: https://github.com/jfhbrook/node-ecstatic#--mime-types-filename
(However, note that the option is not --mime-types
in http-server!)
For example,
$ cat hls/mime.types
ecstatic({ mimeTypes: { 'application/vnd.apple.mpegurl': ['m3u8'] } })
from http-server.
Yes, I'd like to be able to configure additional content types as well.
For instance, text/cache-manifest for .manifest files. Seems to work fine in chrome either way, but I imagine there are other use cases for this feature.
from http-server.
I would love to be able to serve SVGs correctly using the MIME type images/svg+xml
from http-server.
Example mime type file can be found here;
https://github.com/http-party/http-server/blob/93fbb755fe55aa13878af9a91bc8e1a274522dbe/test/fixtures/custom_mime_type.types
from http-server.
In case you landed here to figure out how to use the
--mimetypes
command line option and the syntax of its file, see here: https://github.com/jfhbrook/node-ecstatic#--mime-types-filename (However, note that the option is not--mime-types
in http-server!) For example,$ cat hls/mime.types ecstatic({ mimeTypes: { 'application/vnd.apple.mpegurl': ['m3u8'] } })
Simply creating a custom.types file with "type ext1 ext2" works.
from http-server.
+1, would love it for .webapp
. Pull requests would be welcome!
from http-server.
+1
from http-server.
Any news on HTML 5 video support?
from http-server.
+1 I'm trying to test m3u8 HLS playlists and need to set the mime type
from http-server.
+1 Resource interpreted as Stylesheet but transferred with MIME type application/octet-stream: "http://localhost:8080/less/main.less".
from http-server.
also .less
is not supported +1 for that.
from http-server.
I'll give it a shot. Just got an API implemented in the upstream ecstatic. If it gets accepted and I'm successful here... well, then it's done.
from http-server.
Can someone give me a hand with #152?
I can't figure out how to test the feature with vows. If I start http-server, I can request files with custom mime-types but no matter what I do in http-server-test.js, I get an ECONNREFUSED. I'm pretty sure it's a race condition but I can't figure out how to fix it.
Any ideas?
from http-server.
It'd also be nice if we could map .mpd
to application/dash+xml
for MPEG-DASH.
from http-server.
#152 just needs tests afaict. If anyone wants to right those, I'd be 👍 for merging that. Setting media types correctly is rather essential--and ecstatic
already supports a way to set the mappings (between extension and media type) properly. So. Who's up for writing tests?! 😁
from http-server.
+1 for SVG and/or customizable approach similar local-web-server.
from http-server.
+1
from http-server.
@anderspitman Did you find another option? At some point I switched from http-server
to serve
, but it has the same limitation.
from http-server.
https://crates.io/crates/https: http -m wasm:application/wasm
from http-server.
@ddennedy I'm afraid that didn't seem to change anything for me
from http-server.
Related Issues (20)
- Fails to serve Unity/Brotli HOT 2
- Static File Directory flag HOT 1
- 404 error on the page with param HOT 2
- index.html change but doesn't have any auto refreshing must to manual refresh HOT 4
- Proxy target request header not present HOT 1
- Bug Report HOT 1
- Do not open a new browser window if one is already open HOT 1
- RangeError: Invalid time value HOT 3
- --cors usage is incorrect in the documentation HOT 1
- How to let the json file (*.json) return response header: 'application/json', instead of 'application/json; charset=UTF-8' HOT 1
- OWASP vulnerability in dependency tree HOT 1
- i use it with termux,but i do not know how to upload file to termux HOT 1
- http-server runing on project root folder path without any reasons HOT 2
- {"message":"You are not authorized"} in GitHub Codespace HOT 2
- Support relative path prefixes (base in vite.config.js) HOT 2
- Need a maintainer? HOT 7
- Link not opening in Browser
- Add bandwidth limit parameter HOT 1
- Option -c is not working
- gz not served HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from http-server.