Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

handle mime types #18

Closed
leviwheatcroft opened this issue Jan 8, 2017 · 2 comments
Closed

handle mime types #18

leviwheatcroft opened this issue Jan 8, 2017 · 2 comments

Comments

@leviwheatcroft
Copy link

metalsmith-serve should be able to read mime-types from file meta and set the mimetype on the response header.

I was playing around with it here you can set the mimetype, but node-static just overwrites it. There's a closed issue about this on node-static. There's a number of other (open) issues on node-static re mimetypes. I don't think it's going to be resolved any time soon.

Take a look at this post on the slack channel, it kind of explains the context of what I'm trying to do.

So any ideas on how this might be fixed upstream ? I know it would be impractical to change dependencies for such a small feature, but there are other static servers that could easily resolve this.

@mayo
Copy link
Owner

mayo commented Jan 9, 2017

Hey, I don't really use slack and don't have access to the metalsmith channel, so I can't look at what you're trying to do there.

The spirit of metalsmith-serve (as the readme says) was to ease development of sites and avoid having to build all the time and/or running another tool to test out what you're working for. It never never intended or designed to be a server running your site, as there are tools much better suited for that.

@leviwheatcroft
Copy link
Author

Hey, Totally agree that metalsmith-serve shouldn't aim to be a production server.

Some static hosts (including S3) allow you to set a mime-type for files without extensions, so a static site can get naked urls like http://foo.com/about by renaming about.html to about and setting the mimetype on the response header.

So in order to use metalsmith-serve during development on a site like this, you need similar functionality.

There's a lot of considerations, what I posted on slack sortof puts things in context. Here's a public copy.

@mayo mayo closed this as not planned Won't fix, can't repro, duplicate, stale Dec 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants