mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
15 lines
330 B
TypeScript
15 lines
330 B
TypeScript
import request = require('superagent');
|
|
import proxy = require('superagent-proxy');
|
|
|
|
// Patch superagent with `.proxy()` method
|
|
proxy(request);
|
|
|
|
const callback = (err: any, res: request.Response) => {};
|
|
const proxyUrl = 'http://localhost:8888';
|
|
|
|
// using proxy
|
|
request
|
|
.get('/search')
|
|
.proxy(proxyUrl)
|
|
.end(callback);
|