- Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathfluent-echo.js
More file actions
Latest commit
11 lines (9 loc) · 498 Bytes
/
Copy pathfluent-echo.js
File metadata and controls
11 lines (9 loc) · 498 Bytes
1
2
3
4
5
6
7
8
9
10
11
varInterfake=require('..');
varrequest=require('request');// Let's use request for this example
varinterfake=newInterfake({debug: true});
interfake.post('/echo').echo();
interfake.listen(3030);// The server will listen on port 3030
request({method : 'post',url : 'http://localhost:3030/echo',json : true,body : {echo : 'Echo!'}},function(error,response,body){
console.log(response.statusCode);// prints 200
console.log(body);// prints { "echo" : "Echo!" }
});