Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var abc = require('G:\project\abc.js');
- var nock = require('nock');
- var api = nock("http://localhost:3002")
- .get("/api/test/load/1")
- .reply(200, abc.loadStudy);
- request({ url : 'http://localhost:3002/api/study/load/1', method: 'GET', params: {id : 1}}, function(error, response, body) { console.log(body);} );
- loadStudy = function(req, res) {
- console.log(req);
- var id = req.params.id;
- };
Add Comment
Please, Sign In to add comment