Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    connect-gridfspublic

    connect-gridfs

    GridFS file server for Connect.

    Installation

    npm install connect-gridfs
    

    Options

    • db — previously opened MongoDB Db instance
    • gzip — object with gzip compression settings or true for default gzip settings, defaulting to false (gzipping disable)

    gzip options

    Native gzip options:

    • chunkSize
    • windowBits
    • level
    • memLevel
    • strategy
    • dictionary

    Additional gzip options:

    • minLength — sets the minimum length of a response that will be gzipped, all responses gzipping by default
    • mimeTypes — enables gzipping of responses for the specified MIME types, all responses gzipping by default

    Example

    var http = require('http');
    var mongodb = require('mongodb');
    var connect = require('connect');
    var connectGridfs = require('connect-gridfs');
     
    var app = connect();
    var server = http.createServer(app);
     
    var db = new mongodb.Db('test', new mongodb.Server('127.0.0.1', 27017, { auto_reconnect: true }), { w: 1 });
    db.open(function(err) {
        app.use('/public/', connectGridfs({ db : db, gzip : { level : 4, minLength : 1024 * 16, mimeTypes : ['text/css', 'text/html', 'application/x-javascript'] } }));
        server.listen(3000);
    });

    install

    npm i connect-gridfs

    Downloadsweekly downloads

    10

    version

    0.0.3

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar