1.0.2 • Published 8 years ago

go-fetch-prefix-url v1.0.2

Weekly downloads
7
License
MIT
Repository
github
Last release
8 years ago

go-fetch-prefix-url

Build Status

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))
;