-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from nikksan/main
Initial implementation
- Loading branch information
Showing
19 changed files
with
7,043 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const { backendTs } = require('@luckbox/eslint-rules'); | ||
|
||
module.exports = backendTs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.idea/ | ||
node_modules/ | ||
.eslintcache | ||
dist/ | ||
coverage/ | ||
.vscode/ | ||
tsconfig.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
src/ | ||
examples/ | ||
.eslintrc.js | ||
tsconfig.json | ||
.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: node_js | ||
cache: npm | ||
node_js: | ||
- "stable" | ||
|
||
install: | ||
- npm install | ||
- npm run build | ||
|
||
script: | ||
- npm run test | ||
- npm run coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,32 @@ | ||
# http-adapter-factory | ||
[![Build Status](https://travis-ci.org/LuckboxGG/http-adapter-factory.svg?branch=main)](https://travis-ci.org/LuckboxGG/http-adapter-factory) | ||
|
||
[![Coverage Status](https://coveralls.io/repos/github/LuckboxGG/http-adapter-factory/badge.svg?branch=main)](https://coveralls.io/github/LuckboxGG/http-adapter-factory?branch=main) | ||
|
||
# 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: 'user@exampke.com', | ||
password: '123456' | ||
}); | ||
``` | ||
|
||
## Supported implementations: | ||
|
||
Currently, only one request library is supported - [got](https://github.com/sindresorhus/got#readme) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
roots: ['<rootDir>/src'], | ||
transform: { | ||
'^.+\\.ts$': 'ts-jest', | ||
}, | ||
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.ts$', | ||
moduleFileExtensions: ['ts', 'js'], | ||
} |
Oops, something went wrong.