bigpipe-content
v0.0.5 Bigpipe plugin content delivery server
Bigpipe-content
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
npm i bigpipe-content
Source Code
github.com/Moveo/bigpipe-con...Metadata
- MIT
- Whatever
- Martijn Swaagman
- released 9/30/2013