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

Conversation

@Seraphineyoung
Copy link

Added new blog post ..Handlebars in progress

server.js Outdated
@@ -0,0 +1,48 @@
var fs = require("fs");
var express = require("express");
var express = require("express");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to import express twice here. Also, try to use consts when importing modules. vars have become outdated. https://medium.com/javascript-scene/javascript-es6-var-let-or-const-ba58b8dcde75

) {});
res.send("Yay Node Girls!");

// if (error) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's always a good idea to check for errors :) It's normally the first thing you do before processing any info:

fs.readFile(__dirname + "/data/posts.json", function(error, file) {
    if (error) {
        console.log(error)
    } else {
        // do all the logic here
    }
});

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback, will incorporate this

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