Skip to content

express-server#9

Open
piper88 wants to merge 6 commits intocodefellows-seattle-javascript-401d10:masterfrom
piper88:master
Open

express-server#9
piper88 wants to merge 6 commits intocodefellows-seattle-javascript-401d10:masterfrom
piper88:master

Conversation

@piper88
Copy link
Copy Markdown

@piper88 piper88 commented Sep 27, 2016

No description provided.

Raziyehbazargan pushed a commit to Raziyehbazargan/lab-11-12-express-api that referenced this pull request Sep 27, 2016
Comment thread lab-sarah/README.md

DELETE requests

/api/dog/:id
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread lab-sarah/lib/storage.js
return fs.accessProm(path)
.catch(err => {
if (err.code === 'ENOENT') {
return mkdirp.mkdirpAsync(path);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice job accounting for no data directory!

Comment thread lab-sarah/lib/storage.js
.catch(err => Promise.reject(createError(404, err.message)));
};

exports.availableIDs = function(schemaName) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great job with the bonus!

Comment thread lab-sarah/model/dog.js
.then(newdog => {
for (var key in newdog){
if (key === 'id') continue;
if (_dog[key]) newdog[key] = _dog[key];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🐶

Comment thread lab-sarah/package.json
"superagent": "^2.3.0",
"eslint": "^3.5.0",
"gulp": "^3.9.1",
"gulp-eslint": "^3.0.1"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great work putting your dependencies in the right place!

});
});

before(done => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You have a random before block hanging out there :)

})
.catch(err => done(err));
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You should be deleting the dog in an after block to clean up your database.

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