2.0.0 • Published 7 years ago

api-bro v2.0.0

Weekly downloads
4
License
ISC
Repository
github
Last release
7 years ago

ApiBro

import { default as ApiBro } from 'api-bro'

const client = new ApiBro({
  pathPrefix: 'https://path.to.your.api.endpoint',
  globalHeaders: {
    Authorization: `Bearer ${token}`
  }
})

client.get('apples', { params: { green: true, red: true } }).then(...)
client.post('apples/store', { data: { apples: [...] } })
client.patch ...
client.del ...
client.put ...
// or if you're using cookies
const client = new ApiBro({
  pathPrefix: 'https://path.to.your.api.endpoint',
  withCredentials: true
})

Optional parameters

withCredentials Add withCredentials() to all requests.

pathPrefix Add a prefixed string to each request.

globalHeaders Add headers to each request.

globalParams Add params to all applicable requests.

globalData Add data to all applicable requests

2.0.0

7 years ago

2.0.0-rc5

8 years ago

2.0.0-rc4

8 years ago

2.0.0-rc3

8 years ago

2.0.0-rc2

8 years ago

2.0.0-rc1

8 years ago

1.3.9

8 years ago

1.3.8

8 years ago

1.3.7

8 years ago

1.3.6

8 years ago

1.3.5

8 years ago

1.3.4

8 years ago

1.3.3

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.0

8 years ago

1.1.10

9 years ago

1.1.9

9 years ago

1.1.8

9 years ago

1.1.7

9 years ago

1.1.6

9 years ago

1.1.5

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago