Skip to content

lab 11/12#4

Open
loomnugget wants to merge 3 commits intocodefellows-seattle-javascript-401d10:masterfrom
loomnugget:master
Open

lab 11/12#4
loomnugget wants to merge 3 commits intocodefellows-seattle-javascript-401d10:masterfrom
loomnugget:master

Conversation

@loomnugget
Copy link
Copy Markdown

No description provided.

Raziyehbazargan pushed a commit to Raziyehbazargan/lab-11-12-express-api that referenced this pull request Sep 27, 2016
…ellows/callback-demo

added callback demo
Comment thread claudia-lab/README.md
@@ -0,0 +1,27 @@
##About
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@loomnugget great README!

Comment thread claudia-lab/gulpfile.js
@@ -0,0 +1,24 @@
'use strict';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@loomnugget Good gulpfile - remember to add, remove, or update specific pieces (or tasks) as you need them. This file is meant to help you with your specific workflow and we are totally fine with you modifying this to fit your workflow needs.

err = createError(500, err.message);
res.status(err.status).send(err.name);
next();
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@loomnugget error module looks good!

.catch( err => Promise.reject(createError(500, err.message)));
};

exports.availIDs = 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.

@loomnugget good naming convention

this.color = color;
};

Fruit.createFruit = function(_fruit) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@loomnugget nice use of the underscore in your naming convention to differentiate the passed in fruit reference and a newly instantiated fruit - this is a great pattern.

const fruitRouter = new Router();

//posts a created list
fruitRouter.post('/api/fruit', jsonParser, function(req, res, next){
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@loomnugget great use of jsonParser as a middleware component here

Comment thread claudia-lab/server.js

app.listen(PORT, function(){
debug(`server up ${PORT}`);
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@loomnugget good, clean server file

});

it ('should respond with 404 not found', done => {
request.delete(`${url}/api/fruit/blerg`)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@loomnugget not sure what's going on here - testing a specific test fruit maybe?

});
});//end of testing valid id and body

it ('should respond with 400 - bad request', 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.

@loomnugget good 400 status code test

it ('should respond with 204 successful deletion', done => {
request.delete(`${url}/api/fruit/${this.tempfruit.id}`)
.end((err, res) => {
console.log(this.tempfruit.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.

@loomnugget this is cool for now, moving forward - use debug() or remove console.logs from your pushes on the master branch (which is considered "production") - I know we have talked about your unfamiliarity with GIT in the past, so if you would like, we can discuss this (along with some express stuff - i made a comment about this in your assignment submission) and I'll try to make GIT, branching, and a general GIT workflow not so cumbersome.

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