I was facing the same issue, after hours of searching, I found that downgrading the version of mongoose to 4.7.6 works.
I used below command to downgrade the mongoose module, and then the API worked perfectly.
Thanks for sharing this, Akash. I should have looked at the comments section in the first place. I had the same issue, but with your tip, I managed to solve it.
Hi Samuel,thanks for the tutorial!
I clone from your repo and run on my mac with node v8.9.4.
After run node server.js, 127.0.0.1:4000 works fine. But running curl command like your:
$ curl -H "Content-Type: application/json" -X POST -d '{"name":"Going Shopping"}' localhost:4000/api/add
the server just hanging there not responding anything:
Note: Unnecessary use of -X or --request, POST is already inferred.
After Ctrl+C, server showed:
node server.js
App listening on port 4000
POST /api/add - - ms - -
Could you help me out here? Thank you.
I was facing the same issue, after hours of searching, I found that downgrading the version of mongoose to 4.7.6 works.
I used below command to downgrade the mongoose module, and then the API worked perfectly.
npm install mongoose@4.7.6
Thanks for sharing this, Akash. I should have looked at the comments section in the first place. I had the same issue, but with your tip, I managed to solve it.
Hi Pek,
My bad! I'm just seeing this. I apologize for my late response.
Hope downgrading solves your problem as suggested by @Akash Jobanputra
We can use Postman app to send request form get/post. You will receive response data.