- Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathfluent-proxy.js
More file actions
Latest commit
18 lines (16 loc) · 649 Bytes
/
Copy pathfluent-proxy.js
File metadata and controls
18 lines (16 loc) · 649 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
varInterfake=require('..');
varrequest=require('request');// Let's use request for this example
varinterfake=newInterfake({debug: true});
interfake.get('/interfake-tags').proxy({
url: 'https://api.github.com/repos/basicallydan/interfake/tags',
headers: {
'User-Agent': 'Interfake Proxy Whoop',
'Accept': 'application/vnd.github.full+json'
}
});
interfake.listen(3030);// The server will listen on port 3030
request('http://localhost:3030/interfake-tags',function(error,response,body){
console.log(error);
console.log(response.statusCode);// prints 200
console.log(body);// prints { "next" : "more stuff" }
});