My answer below is almost identical to the official answer and produces the same output, which is not "correct" in that it spans multiple lines and the correct output is all one line. I don't see anything wrong with my code.
var fs = require('fs');
var express = require('express');
var app = express();
My answer below is almost identical to the official answer and produces the same output, which is not "correct" in that it spans multiple lines and the correct output is all one line. I don't see anything wrong with my code.
var fs = require('fs'); var express = require('express'); var app = express();
app.get('/books', function(request, response) { fs.readFile(process.argv[3], function(error, data) { if (error) { console.log(error); } response.json(JSON.parse(data)); }); }); app.listen(process.argv[2]);