test route
/route.js
content:
exports = [
//mock with json data
{path:"/service/login.do",data:{"auth-token":"sdeee23734ru3hfbvncm"}},
//mock from remote url
{path:"/service/user.do",remote:"http://test.com/user.do"},
//mock from local json file
{path:"/service/user.do",file:"./mock/user.json"},
//mock with nodejs request handle
{
path: /\/service\/user\/(\d+)/,
action: function(request,response,path,uid){
var headers = {"Content-Type":"text/json;charset=utf-8"};
response.writeHead(200, headers);
response.end(JSON.stringify({"uid":uid}));
return true;
}
}
]