khask /

Filename Size Date modified Message
Database/MongoDB
88 B
support for arbitrary paths, real mimetypes
1.1 KB
init
2.4 KB
add stack support. Update to newer GridFS driver.
1.6 KB
add stack support. Update to newer GridFS driver.
3.8 KB
add stack support. Update to newer GridFS driver.
1.4 KB
add stack support. Update to newer GridFS driver.
59 B
add stack support. Update to newer GridFS driver.

Khask

Khask is a HTTP file server with a GridFS (MongoDB) backend, written in Haskell.

MongoDB includes a specification for storing large files, called GridFS. I've found it to be a pretty low-fuss way to get network-attached file storage.

There wasn't a nice way to serve those files to the web, so I wrote Khartoum (in Python). Then I started learning Go, and rewrote Khartoum in it as a learning exercise. The result was Khargo, which is a bit more polished than Khartoum ever was.

Khask is my rewrite of the same application in Haskell.

Features

  • Serving files from GridFS (duh).
  • Setting the appropriate Content-Type header.
  • Serving gzipped content to clients that support it.
  • Setting the ETag header to the md5 of the file's content.
  • CORS support. The Access-Control-Allow-Origin header is set to "*", so you can serve web fonts from khask without complaints from IE and Firefox.

The intended use case is as an origin server sitting behind a CDN. So your applications can store files in MongoDB, and they'll then be accessible from the web.

Here Be Dragons

Consider this alpha-quality software. Only run it in production if you're comfortable reading through the code and making changes.

TODO