Skip to content
This repository was archived by the owner on Aug 17, 2024. It is now read-only.

Conversation

@MHDGhanemBalhawan
Copy link

Hi,
Please review my file.
Thank you and regards,
Steve

console.log("Saved!");
});

fs.appendFile("data/posts.json", json(req.fields), function(error) {

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) {

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) {

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");
Copy link

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.

Copy link

@nennes nennes left a 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants