go-fetch-prefix-url
v1.0.2
Published
Prefix each request URL with another URL unless the URL is absolute.
Downloads
11
Maintainers
Readme
go-fetch-prefix-url
Prefix each request URL with another URL unless the URL is absolute.
Installation
npm install --save go-fetch-prefix-url
Usage
const Client = require('go-fetch');
const prefixUrl = require('go-fetch-prefix-url');
new Client()
.use(prefixUrl('https://api.github.com'))
.get('/repos/go-fetch-js/prefix-url', {'User-Agent': 'go-fetch'})
.then(res => console.log(res.status))
.catch(err => console.error(err.stack))
;