0.0.5 • Published 11 years ago

bigpipe-content v0.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
11 years ago

Bigpipe-content

Build
Status NPM version

Bigpipe plugin that will stream static content as fast as possible. If you need images or documents delivered from a public directory this bigpipe plugin will enable you to do just that. Note: files are not cached.

Features

  • Uses the options#public directory and it subdirectories to serve static content
  • Mime types are automatically added by the send module.
  • Will delegate requests to Bigpipe#dispatch if the uri.pathname is not found.

Installation

Bigpipe-content is released in npm and can be installed using:

npm install bigpipe-content --save

To use the plugin from Bigpipe, simply add it after Bigpipe is initialized or add it to options#plugins. bigpipe.use will execute the plugin logic. Make sure the plugin name is unique, e.g. content by default.

// Usage after initialization
var content = require('bigpipe-content')
  , Pipe = require('bigpipe');

var pipe = new Pipe(http.createServer(), {
    pages: __dirname + '/pages',
    public: __dirname + '/public'
  }).listen(8080).use(content);
// Usage through createServer options
var content = require('bigpipe-content')
  , Pipe = require('bigpipe');

var pipe = Bigpipe.createServer(8080, {
      pages: __dirname + '/pages',
      public: __dirname + '/public',
      plugins: [ content ]
    });

License

MIT

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago