Skip to content

exercise-express -- Griffiths#19

Open
crgriffiths wants to merge 3 commits into
pce-uw-jscript400:masterfrom
crgriffiths:master
Open

exercise-express -- Griffiths#19
crgriffiths wants to merge 3 commits into
pce-uw-jscript400:masterfrom
crgriffiths:master

Conversation

@crgriffiths
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
Contributor

@bwreid bwreid left a comment

Choose a reason for hiding this comment

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

Great job! There are a few things that are different than the instructions, but overall everything seems to work well.

Comment thread app.js

if (!fruit) {
const message = `Could not find fruit with ID of ${id}`
next({ status: 404, message })
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You should return here, to avoid the error of:

Cannot set headers after they are sent to the client

Comment thread app.js
}

const fruit = fruits.splice(fruitIdx,1);
res.json(fruit)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This will return an array as opposed to an object, which is what the instructions ask for.

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