Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add features to test client

  • Loading branch information...
commit 19a033647e21c19c1d7549d49b276294a9a15ea3 1 parent 76e2cb1
@prashtx prashtx authored
Showing with 10 additions and 8 deletions.
  1. +5 −4 survey_constructor.json
  2. +5 −4 testclient.js
View
9 survey_constructor.json
@@ -5,12 +5,13 @@
, "paperinfo": {
"dpi": 150
, "regmarks": [
- {"type": 0, "bbox": [50, 50, 250, 250]}
- , {"type": 0, "bbox": [50, 1400, 250, 1600]}
- , {"type": 0, "bbox": [1025, 1400, 1225, 1600]}
+ {"type": 0, "bbox": [20, 20, 70, 70]}
+ , {"type": 0, "bbox": [20, 1580, 70, 1630]}
+ , {"type": 0, "bbox": [1205, 1580, 1255, 1630]}
]
- , "barcode": {"bbox": [975, 50, 1225, 300]}
+ , "barcode": {"bbox": [1055, 20, 1255, 220]}
}
}
]
}
+
View
9 testclient.js
@@ -3,7 +3,7 @@ var fs = require('fs');
var BASEURL = process.env.BASEURL || 'http://localhost:3000';
-var SURVEYID = '1';
+var SURVEYID = process.env.SURVEYID || '1';
function JSONpretty(data) {
return JSON.stringify(data, null, ' ');
@@ -343,8 +343,9 @@ function getsurvey(sid) {
}
// Add a new survey object
-function addsurvey() {
- var input_file = 'survey_constructor.json';
+function addsurvey(input_file) {
+ if (input_file == undefined)
+ input_file = 'survey_constructor.json';
var url = BASEURL + '/surveys';
data = JSON.parse(fs.readFileSync(input_file, 'utf8'));
console.log('Adding survey with data:');
@@ -502,7 +503,7 @@ switch(cmd) {
getsurvey(process.argv[3]);
break;
case 'addsurvey':
- addsurvey();
+ addsurvey(process.argv[3]);
break;
// Scans
Please sign in to comment.
Something went wrong with that request. Please try again.