1.0.8 • Published 9 years ago
trucks-resolver-http v1.0.8
HTTP Resolver
HTML import resolver for the http: and https: schemes.
Resolves HTML imports using the http: and https: schemes.
<link rel="import" href="https://example.com/components.html">Install
npm i trucks-resolver-http --save-devFor the command line interface see trucks-cli.
Usage
Register the http protocol plugin:
const options {
files: ['https://example.com/components.html'],
protocols: ['http']
}API
HttpResolver
Resolve http: and https: protocols.
HttpResolver
public HttpResolver()Create an HTTP resolver.
resolve
public resolve(cb)Loads a remote HTTP resource from the network and invokes callback with the response body.
If the response has a Content-Encoding containing gzip it is deflated.
cbFunction callback function.
http
public http(state, conf)Plugin for the http resolver.
Registers the resolver class for the http: and https: protocols unless
the secure option is given in which case the http: protocol is not
registered and attempts to use http: URLs in HTML imports will generate
errors.
stateObject compiler state.confObject plugin configuration object.
Options
secureBoolean=false only usehttps:.
License
MIT
Created by mkdoc on July 22, 2016