run the following command in the terminal of the root directory
go run main.go
The server runs on:-
(JSON data)
{
"name" : "username", "email" : "abc@gmail.com", "password: : "user1234"
}
http://localhost:8000/users/{id}
replace {id} with the user id from mongodb
(JSON data)
{
"id" : "userid" "caption" : "your captions" "url" : "image url" "time" : "time of post"
}
http://localhost:8000/posts/{id}
replace the {id} with the post id from mongodb
http://localhost:8000/posts/users/{id}
replace the {id} with the user id for which you want the posts