go-fetch-prefix-url

1.0.2 • Public • Published

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

Dependents (1)

Package Sidebar

Install

npm i go-fetch-prefix-url

Weekly Downloads

2

Version

1.0.2

License

MIT

Last publish

Collaborators

  • jameslnewell