Naphthalene Possum Management

    This package has been deprecated

    Author message:

    Use middleware for static content delivery

    bigpipe-content

    0.0.5 • Public • Published

    Bigpipe-content

    BuildStatus 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

    Install

    npm i bigpipe-content

    DownloadsWeekly Downloads

    6

    Version

    0.0.5

    License

    MIT

    Last publish

    Collaborators

    • swaagie