1.2.0 • Published 9 years ago

bigpipe-domain v1.2.0

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

BigPipe - Plugin Domain

Version npmBuild StatusDependenciesCoverage Status

BigPipe's CSS/JS resources are exposed on / by default. It's possible to serve resources from another server or scoped domain with this plugin.

Install

npm install bigpipe-domain --save

Usage

Configure a domain on which bigpipe resources will be supplied. The pathname of the file is merged with the pathname of the domain configuration. For example, the configuration below will serve 1fb1d9e0d989a5673eb0d69c904b804b3a38f483.js as https://subdomain.bigpipe.com:1337/path/to/sub/1fb1d9e0d989a5673eb0d69c904b804b3a38f483.js.

var domain = require('bigpipe-domain')
  , BigPipe = require('bigpipe');

BigPipe.createServer(1337, {
  plugins: [ domain ],
  domain: {
    pathname: '/path/to/sub',
    hostname: 'subdomain.bigpipe.com',
    protocol: 'https',
    port: 1337
  }
});

Scoping the resources to just a prepended pathname is possible as well. Simply provide the domain as string. The example below will scope 1fb1d9e0d989a5673eb0d69c904b804b3a38f483.js as /path/to/sub/1fb1d9e0d989a5673eb0d69c904b804b3a38f483.js.

var domain = require('bigpipe-domain')
  , BigPipe = require('bigpipe');

BigPipe.createServer(1337, {
  plugins: [ domain ],
  domain: '/path/to/sub'
});

License

MIT

1.2.0

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago