node.js - retrieving json properties from databse using express -
i new express. have created api crud app in express access cloudant db. now want parse properties json files have on db , put them properties. i have tried " request ( url, function(error, response, data) { body = data; } didn't work. body undefined. var express = require('express'); var http = require('http'); var app = express(); var bodyparser = require('body-parser'); var request = require("request"); var body; var cloudant = require('cloudant'); app.set('port', process.env.port || 3000); app.set('json spaces', 2); app.use(bodyparser.json()); app.use(bodyparser.urlencoded({ extended: true })); //==== configure database ======================================// var services = json.parse(process.env.vcap_services || "{}"); var cloudantcreds = {}; (var servicename in services) { if (servicename.indexof("cloudantnosqldb") > -1) { cloudantcreds = servic...