Commit 68db7c41 authored by Severine Duvaud's avatar Severine Duvaud
Browse files

Fixed issue with empty datasets + added request and mongodb to package.json

parent 0c6f7d58
...@@ -8,7 +8,7 @@ info.getDatasetsFromArrayMap(function (callback){ ...@@ -8,7 +8,7 @@ info.getDatasetsFromArrayMap(function (callback){
infoObject = callback; infoObject = callback;
}); });
var infoObject = {}; var infoObject = {message : "loading datasets from arraymap api, please refresh the page in a few seconds..."};
function checkDatasetIdentifier(params) { function checkDatasetIdentifier(params) {
......
...@@ -7,10 +7,11 @@ var url = "http://arraymap.org/api/?db=arraymap&api_out=icdmlist&api_out=icdmlis ...@@ -7,10 +7,11 @@ var url = "http://arraymap.org/api/?db=arraymap&api_out=icdmlist&api_out=icdmlis
module.exports = { module.exports = {
getDatasetsFromArrayMap: function(callback) { getDatasetsFromArrayMap: function(callback) {
var object = {}; var object;
request(url, function (error, response, body) { request(url, function (error, response, body) {
if (!error && response.statusCode == 200) { if (!error && response.statusCode == 200) {
object = getDatasets(JSON.parse(body)); object = getDatasets(JSON.parse(body));
console.log(object)
callback(object); callback(object);
} }
else { else {
......
...@@ -17,7 +17,9 @@ ...@@ -17,7 +17,9 @@
"monk": "^1.0.1", "monk": "^1.0.1",
"morgan": "~1.6.1", "morgan": "~1.6.1",
"serve-favicon": "~2.3.0", "serve-favicon": "~2.3.0",
"underscore": "^1.8.3" "underscore": "^1.8.3",
"request": "^2.74.0",
"mongodb": "^2.2.4"
}, },
"devDependencies": { "devDependencies": {
"mocha": "^3.0.2", "mocha": "^3.0.2",
......
Supports Markdown
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