So this is what I have in my server.js file.
var app = require('express')();
bodyParser = require('body-parser');
app.listen(3000);
app.use(bodyParser.urlencoded({
extended true
}));
app.use(bodyParser.json());
app.get('/items', function(req, res) {
data = {
brains: "squishy",
relationships: "squishy",
tickles: "harsh",
taste: "sweet"
}
console.log(data.brains);
});
I want all of my data as an output so I console logged data.brains and then when i checked my node inside my terminal, it will not generate any output getting stuck at starting 'node server.js' .. I don't know why it's not working. What is the issue?
node server.js2) while the command is still running, go tohttp://localhost:3000/in a browser 3) check the console againhttp://localhost:3000/itemsafter fixing the error that Jordan pointed out.