jdx / mean-sample

Sample project for Write Modern Web Apps with the MEAN Stack by Jeff Dickey
https://mean-sample.herokuapp.com
165 stars 90 forks source link

The curl command does not work for me in chapter 4 #25

Closed Alayode closed 9 years ago

Alayode commented 9 years ago

Using mongoose models with the post endpoint

admins-mbp:~ admin$ curl -v -H "Content-Type:application/json" -XPOST --data "{\"username\":\"dickeyxxx\",\"body\":\"node rules\"}" http://localhost:3000/api/posts/

Here in the code I am trying test to see if the post work but it is saying the connection is refused the server is up and the folder is not in the root so when i install node modules i must use sudo npm install in order for it to work.

I am not sure if this is a big issue but I am able to see my 201 come back after each refresh so no issues there. I would like to know how to use curl to test this though.

thanks

jdx commented 9 years ago

is your server running on port 3000?

Alayode commented 9 years ago

yes the server is running on port 3000 and i then open a new window in my terminal and then run that curl command.

I made a screen capture of my actual use of the command during development.

https://www.dropbox.com/s/t1y08akutsjc679/dickeyxxx-curl-failed.mov?dl=0

Alayode commented 9 years ago

I was able to resolve this issue apparently I added nodemon and all the components for chapter 5 up until FIXING THE POST ORDERING I will leave a link to a screenshot doing so I have multiple local servers running at the moment and maybe there was some sort of conflict. https://www.dropbox.com/s/yds4hpkkoo22xol/Screenshot%202015-04-29%2017.09.21.png?dl=0

alexhwebdev commented 8 years ago

Im having the same issue and not really understanding the fix for this. I tried to uninstall nodemon and still "Connection refused". What was it that you exactly did to fix the connection issue? Thanks in advance.