-
Notifications
You must be signed in to change notification settings - Fork 131
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
base: master
Are you sure you want to change the base?
Conversation
summary: Add to Cart | ||
description: Add a product to the users cart | ||
tags: | ||
- addToCart |
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.
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 |
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.
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 | ||
|
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.
Would add in const path = require("path");
server.listen(PORT, () => { | ||
// Load brands data | ||
brands = JSON.parse(fs.readFileSync('../initial-data/brands.json', 'utf-8')) |
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.
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", |
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.
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') |
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.
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 |
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.
Try to remember to add semi-colons at the end of the line
No description provided.