Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carly Burkhart - Completed Project #154

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

TimeIsOnMySide
Copy link

No description provided.

summary: Add to Cart
description: Add a product to the users cart
tags:
- addToCart
Copy link

Choose a reason for hiding this comment

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

might be better to just have everything cart related under the tag of Cart

summary: Sunglasses from a specific brand
description: displays products from a specific brand
tags:
- brand id
Copy link

Choose a reason for hiding this comment

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

could also be tagged under Products

var queryString = require('querystring')
var Router = require('router')
var bodyParser = require('body-parser')
var uid = require('rand-token').uid

Copy link

Choose a reason for hiding this comment

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

Would add in const path = require("path");

server.listen(PORT, () => {
// Load brands data
brands = JSON.parse(fs.readFileSync('../initial-data/brands.json', 'utf-8'))
Copy link

Choose a reason for hiding this comment

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

would recommend using path like this
brands = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../initial-data/brands.json'), 'utf-8'))

@@ -11,10 +11,16 @@
"license": "ISC",
Copy link

Choose a reason for hiding this comment

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

under scripts you could add one for test and instead of node you do mocha .\app\server-test

var bodyParser = require('body-parser');
var uid = require('rand-token').uid;
var http = require('http')
var fs = require('fs')
Copy link

Choose a reason for hiding this comment

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

Stay consistent with variable declaration instead of switching between var and let/const


http.createServer(function (request, response) {
// Variables
let brands = [] //list of all brands from json file
Copy link

Choose a reason for hiding this comment

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

Try to remember to add semi-colons at the end of the line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants