handlerCreatePost printing HTTP status 201 but no post is created

Viewed 13

Error Synopsis: After user is created, handlerCreatePost is called to create a fun body of text like "Hello, World.". After calling the post method, a 201 status is given, signaling that the parameters are good and there is nothing wrong with the parameters the user has given, but no post is created

Steps to reproduce:

  1. go build && ./SocialServer
  2. Call POST http://localhost:8080/users/test@example.com to create the user with the given email
  3. Call POST http://localhost:8080/posts/. This should call on the existing user email to attach a post to the username. 4.) You should see an instance of a post created in the http response body, but none created in the db.json file.

Here is the link to the repo:

https://github.com/BevansMath/SocialServer

0 Answers
Related