Skip to content
This repository was archived by the owner on Apr 9, 2020. It is now read-only.

Sending error in json to unmatched routes#43

Open
himanshuc3 wants to merge 1 commit intocoding-blocks:masterfrom
himanshuc3:error
Open

Sending error in json to unmatched routes#43
himanshuc3 wants to merge 1 commit intocoding-blocks:masterfrom
himanshuc3:error

Conversation

@himanshuc3
Copy link
Copy Markdown

There was not enough information on issue, So I thought unmatched route error message have to be sent in json.
Issue #13

Comment thread routes/api/index.js

app.get('*', (req, res) => {
res.status(404).json({
"error": "404",
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.

a json cannot have two keys of the same name. like javascript 101 my friend.

please at least run your code before you make PRs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants