We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c1071d commit aa729bbCopy full SHA for aa729bb
_comments.json
@@ -0,0 +1,6 @@
1
+[
2
+ {
3
+ "author": "Pete Hunt",
4
+ "text": "Hey there!"
5
+ }
6
+]
server.js
@@ -1,8 +1,9 @@
+var fs = require('fs');
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
-var comments = [{author: 'Pete Hunt', text: 'Hey there!'}];
+var comments = JSON.parse(fs.readFileSync('_comments.json'))
7
8
app.use('/', express.static(__dirname));
9
app.use(bodyParser.json());
0 commit comments