How to use the mime.Mime.mimeType function in mime

To help you get started, we’ve selected a few mime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kriskowal / narwhal-lib / lib / jack / file.js View on Github external
Jack_File.serve = function(path, contents) {
    var body = contents,
        size = contents.getLength();

    return [200, {
        //"Last-Modified"  : File.mtime(path).httpdate(),
        "Content-Type"   : Mime.mimeType(File.extname(path), "text/plain"),
        "Content-Length" : String(size)
    }, body];
}