Skip to content

Commit

Permalink
feat: remove http client adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoGathK committed Oct 21, 2022
1 parent 7c1ded6 commit 1d6ac1f
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 178 deletions.
131 changes: 0 additions & 131 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
},
"dependencies": {
"@vodyani/class-decorator": "^8.2.3",
"@vodyani/core": "^8.9.2",
"agentkeepalive": "^4.2.1",
"axios": "^0.27.2"
}
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './common';
export * from './provider';
export * from './struct';
31 changes: 0 additions & 31 deletions src/provider/client.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/provider/index.ts

This file was deleted.

16 changes: 3 additions & 13 deletions test/http-client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as express from 'express';
import * as bodyParser from 'body-parser';
import * as formidable from 'express-formidable';

import { AgentKeepAlive, HttpClientAdapter } from '../src';
import { AgentKeepAlive, HttpClient } from '../src';

let server: Server = null;
let app: express.Express = null;
Expand All @@ -18,18 +18,11 @@ const imageBaseUrl = 'https://avatars0.githubusercontent.com';
const imageBasePath = '/u/49223198?v=3&s=55';

const httpAgent = new AgentKeepAlive({ timeout: 15000 });
const imageProvider = new HttpClientAdapter();
const provider = new HttpClientAdapter();

imageProvider.create({ baseURL: imageBaseUrl, httpAgent });
provider.create({ baseURL, httpAgent });
provider.redeploy({ baseURL, httpAgent });
const imageClient = new HttpClient({ baseURL: imageBaseUrl, httpAgent });
const client = new HttpClient({ baseURL, httpAgent });

const tempPath = resolve(__dirname, './temp');

const client = provider.connect();
const imageClient = imageProvider.connect();

beforeAll(async () => {
app = express();
app.use(bodyParser.json());
Expand Down Expand Up @@ -62,9 +55,6 @@ afterAll(async () => {

rmSync(tempPath + '/temp.png');
rmdirSync(tempPath);

provider.close();
imageProvider.close();
});

describe('HttpClient', () => {
Expand Down

0 comments on commit 1d6ac1f

Please sign in to comment.