express-server#9
Open
piper88 wants to merge 6 commits intocodefellows-seattle-javascript-401d10:masterfrom
Open
express-server#9piper88 wants to merge 6 commits intocodefellows-seattle-javascript-401d10:masterfrom
piper88 wants to merge 6 commits intocodefellows-seattle-javascript-401d10:masterfrom
Conversation
Raziyehbazargan
pushed a commit
to Raziyehbazargan/lab-11-12-express-api
that referenced
this pull request
Sep 27, 2016
…ellows/lec-08 added lecture-08
stefuhnee
reviewed
Sep 30, 2016
|
|
||
| DELETE requests | ||
|
|
||
| /api/dog/:id |
There was a problem hiding this comment.
I would specify that these are routes, and tell the user that whatever comes after /dog/ represents the id (since it's not immediately obvious with :id unless they're familiar with Express).
stefuhnee
reviewed
Sep 30, 2016
| return fs.accessProm(path) | ||
| .catch(err => { | ||
| if (err.code === 'ENOENT') { | ||
| return mkdirp.mkdirpAsync(path); |
There was a problem hiding this comment.
Nice job accounting for no data directory!
stefuhnee
reviewed
Sep 30, 2016
| .catch(err => Promise.reject(createError(404, err.message))); | ||
| }; | ||
|
|
||
| exports.availableIDs = function(schemaName) { |
stefuhnee
reviewed
Sep 30, 2016
| .then(newdog => { | ||
| for (var key in newdog){ | ||
| if (key === 'id') continue; | ||
| if (_dog[key]) newdog[key] = _dog[key]; |
stefuhnee
reviewed
Sep 30, 2016
| "superagent": "^2.3.0", | ||
| "eslint": "^3.5.0", | ||
| "gulp": "^3.9.1", | ||
| "gulp-eslint": "^3.0.1" |
There was a problem hiding this comment.
Great work putting your dependencies in the right place!
stefuhnee
reviewed
Sep 30, 2016
| }); | ||
| }); | ||
|
|
||
| before(done => { |
There was a problem hiding this comment.
You have a random before block hanging out there :)
stefuhnee
reviewed
Sep 30, 2016
| }) | ||
| .catch(err => done(err)); | ||
| }); | ||
|
|
There was a problem hiding this comment.
You should be deleting the dog in an after block to clean up your database.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.