I'm new Node.js and server side scripting in general and am currently practicing with the brewerydb-node wrapper found here(https://www.npmjs.com/package/brewerydb-node)
I currently have the following server side code that will log the appropriate JSON object to the command line
var express = require('express');
var app = express();
var morgan = require('morgan');
var bodyParser = require('body-parser');
var BreweryDb = require('brewerydb-node');
var brewdb = new BreweryDb([api-key here]);
var request = require('request');
app.use(bodyParser.json());
brewdb.breweries.getById("g0jHqt", {}, function(err, beer) {
if(err) {
console.log(res.statusCode());
} else {
console.log(beer.name);
}
})
app.listen(8000, function() {
console.log("Listening at http://localhost:8000");
})
I'm not sure how I would go about having this object be sent as a response to which I could parse through with my client side code as there are no 'res' or 'req' parameters in this wrapper.