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.
npm install bigpipe-domain --save
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'
});
MIT