Skip to content

LuckboxGG/http-adapter-factory

Repository files navigation

Build Status

Coverage Status

Http Adapter Factory

A factory producing http adapters with different(in the near future) underlying library implementations.

Usage

import HttpAdapterFactory from '@luckbox/http-adapter-factory';

const httpAdapterFactory = new HttpAdapterFactory();
const httpAdapter = httpAdapterFactory.create({
  timeout: 10000
});

/* ... */
await httpAdapter.get('http://example.com', { bar: 'foo '});
await httpAdapter.post('http://example.com', {
  email: '[email protected]',
  password: '123456'
});
await httpAdapter.delete('http://example.com/123');
await httpAdapter.patch('http://example.com/123', {
  bar: '[email protected]',
});
await httpAdapter.put('http://example.com/123', {
  bar: '[email protected]',
});

Supported implementations:

Currently, only one request library is supported - got

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published