Skip to content

Commit c6c8f1f

Browse files
author
Andrew Switlyk
committed
update comments variable after get request to "comments.json"
1 parent 558e0c7 commit c6c8f1f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

server.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ app.use(bodyParser.urlencoded({extended: true}));
2525
app.get('/comments.json', function(req, res) {
2626
res.setHeader('Content-Type', 'application/json');
2727
res.send(JSON.stringify(comments));
28+
comments = JSON.parse(fs.readFileSync('_comments.json'));
2829
});
2930

3031
app.post('/comments.json', function(req, res) {

0 commit comments

Comments
 (0)