|
@@ -58,7 +58,7 @@ function search(url, body, res)
|
|
|
);
|
|
|
}
|
|
|
|
|
|
-function query(url, req, res)
|
|
|
+function query(url, query_result, req, res)
|
|
|
{
|
|
|
request.post({
|
|
|
url: url,
|
|
@@ -93,11 +93,10 @@ app.all('/search', function (req, res) {
|
|
|
search('http://mongodb_jsonendpoint:8000/search', req.body, res);
|
|
|
});
|
|
|
|
|
|
-var query_result = [];
|
|
|
app.all('/query', function (req, res) {
|
|
|
- query_result = [];
|
|
|
- query('http://mysql_jsonendpoint:8000/query', req);
|
|
|
- query('http://mongodb_jsonendpoint:8000/query', req, res);
|
|
|
+ var query_result = [];
|
|
|
+ query('http://mysql_jsonendpoint:8000/query', query_result, req);
|
|
|
+ query('http://mongodb_jsonendpoint:8000/query', query_result, req, res);
|
|
|
});
|
|
|
|
|
|
app.listen(8000);
|