/superinstance

allow creation of separate instances of superagent

Primary LanguageJavaScript

superinstance

allow creation of separate instances of superagent

Build Status codecov npm downloads js-standard-style Commitizen friendly semantic-release

Usage

import request from 'superinstance';
const server = express();
const app = request(server); // or request('http://example.io/');
const instance = app.set('authorization', `Bearer ${token}`);

await instance.post('/graphql').send({ query, variables: { input } });
await instance.get('/image');
...