Skip to content

bigpipe/plugin-domain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Scope the resources from the compiler to a domain

Resources

License

Stars

Watchers

Forks

Packages

No packages published