-
-
Notifications
You must be signed in to change notification settings - Fork 93
Steve express-workshop #8
base: master
Are you sure you want to change the base?
Steve express-workshop #8
Conversation
| console.log("Saved!"); | ||
| }); | ||
|
|
||
| fs.appendFile("data/posts.json", json(req.fields), function(error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this append the data in a format which you are able to read it again?
|
|
||
| const fs = require("fs"); | ||
|
|
||
| fs.appendFile("message.txt", "data to append", function(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for appending the data to 2 files: message.txt and data/posts.json?
| res.end("Thank you for submitting the form!"); | ||
| }); | ||
|
|
||
| fs.readFile(__dirname + "/data/posts.json", function(error, file) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is not attached to any route. This means it will only be executed once at startup and then never again. Did you manage to make it work?
| const app = express(); | ||
| const formidable = require("express-formidable"); | ||
| const fs = require("fs"); | ||
| // const http = require("http"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general it's not a god prctice to live commented code into git. Something is either needed / works or not. Commented code is a grey area that confuses everyone else.
nennes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please complete the Handlebars task.
Hi,
Please review my file.
Thank you and regards,
Steve