Commit 6bf85b33 authored by project's avatar project

--no commit message

--no commit message
parent c903d30c
How to build xml2json
- install C++11 Compiler
- scl enable devtoolset-2 bash
- npm install
(for centos : http://hiltmon.com/blog/2015/08/09/c-plus-plus-11-on-centos-6-dot-6/)
\ No newline at end of file
...@@ -102,8 +102,11 @@ router.get('/:id/objects',function (req, res) { ...@@ -102,8 +102,11 @@ router.get('/:id/objects',function (req, res) {
var cont = true; var cont = true;
if(idx > rec_count){cont=false;} if(idx > rec_count){cont=false;}
rd.moveTo(idx); rd.moveTo(idx);
//start stream response
res.type('application/json');
res.send('[');
async.whilst( async.whilst(
function() { return cont; }, function() { return cont; },
function(callback){ function(callback){
...@@ -112,17 +115,21 @@ router.get('/:id/objects',function (req, res) { ...@@ -112,17 +115,21 @@ router.get('/:id/objects',function (req, res) {
if(!obj){ if(!obj){
cont=false; cont=false;
}else{ }else{
//console.log(obj); var objout = obj_out(obj);
obj_return.push(obj_out(obj)); res.send(objout);
if(limit>0 && idx>=from_seq+limit){ if(limit>0 && idx>=from_seq+limit){
cont=false; cont=false;
}else{
res.send(',');
} }
} }
callback(); callback();
}); });
},function(err){ },function(err){
res.send(']');
bss.close(function(err){ bss.close(function(err){
respHelper.responseOK(obj_return); res.status(200).end();
//respHelper.responseOK(obj_return);
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment