-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
res.status is not a function #1
Comments
Error handling The default error handler chapter: https://expressjs.com/en/guide/error-handling.html
|
Try this code if it works app.use(function (err, req, res, next) {
}) app.use(function(err, req, res, next) { res.json({ |
Hi,
Solved that issue. by adding extra params
…On Thu, Oct 4, 2018 at 1:56 AM Jeremy Bacca Barquero < ***@***.***> wrote:
Try this code if it works
app.use(function (err, req, res, next) {
res.status(err.status || 500);
res.json({
errors: {
message: err.message,
error: err,
},
});
})
}
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.json({
errors: {
message: err.message,
error: {},
},
});
});
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AdOtOJCm6fuwAdnwZ6eNMP5ti-FMdodXks5uhR1fgaJpZM4VgAQ->
.
|
hey @DarveshHere I'm having this error : { when trying to POST a user , could you help me please? regards |
Hi Darvesh,
Kindly send this payload from the front end or postman .
{ email: "[email protected]", password:"xxxx"}
Note:- POST request with body containing keys email and password.
…On Wed, Oct 31, 2018 at 8:48 PM llermaly ***@***.***> wrote:
hey @DarveshHere <https://github.com/DarveshHere> I'm having this error :
{
"errors": {
"message": "Cannot read property 'email' of undefined",
"error": {}
}
}
when trying to POST a user , could you help me please?
regards
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AdOtOF9L7pVLZ3witeIbNZQxxoacTY9Sks5uqb84gaJpZM4VgAQ->
.
|
i get a POST /users 404 0.404 ms - 145 can someone help me ? it appears after i changed the extra next argument |
please fix this code correct i want to learn from this code :) |
Make sure your POSTMAN GET request has Headers; Key:Token and Content-type:application/json. If your getting the Email of undefined your POST request in POSTMAN is missing content-type:application/json. |
I am getting the same error: res.status is not a function
but continue to get the same error. Is there a working example of this code anywhere? Regards, Daryl |
replace line ** return status(400).info** |
I too am experiencing a problems related to this bug and the suggested fixes are not quite working for me. On, lines 41 & 53 in app.js, I have:
and on line 67 in users.js, I have:
however, when I start and visit http://localhost:8000/, I get the message in the browser:
|
I am getting the same problem as @williehallock802 |
I have the same error as above ^ |
i am getting this issue
The text was updated successfully, but these errors were encountered: