Guest User

Untitled

a guest
Mar 17th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. var abc = require('G:\project\abc.js');
  2. var nock = require('nock');
  3.  
  4. var api = nock("http://localhost:3002")
  5. .get("/api/test/load/1")
  6. .reply(200, abc.loadStudy);
  7.  
  8. request({ url : 'http://localhost:3002/api/study/load/1', method: 'GET', params: {id : 1}}, function(error, response, body) { console.log(body);} );
  9.  
  10. loadStudy = function(req, res) {
  11. console.log(req);
  12. var id = req.params.id;
  13. };
Add Comment
Please, Sign In to add comment