This is a set of API for a social network that uses a MongoDB database so that the website can handle large amounts of unstructured data, Express.js for routing, Mongoose ODM, and the moment package to format time stamps.
- Clone GitHub repository
- npm init
- Ensure that MongoDB and Express are installed on your computer.
- Invoke application using npm start.
Testing restful API calls with Insomnia Core
/api/users
GET
all usersPOST
a new user:// example data { "username": "lernantino", "email": "lernantino@gmail.com" }
/api/users/:userid
GET
a single user by its_id
PUT
to update a user by its_id
DELETE
to remove user by its_id
/api/users/:userId/friends/:friendId
POST
to add a new friend to a user's friend listDELETE
to remove a friend from a user's friend list
/api/thoughts
GET
to get all thoughtsPOST
to create a new thought// example data { "thoughtText": "Here's a cool thought...", "username": "lernantino", "userId": "5edff358a0fcb779aa7b118b" }
/api/thoughts/:thoughtId
GET
to get a single thought by its_id
PUT
to update a thought by its_id
DELETE
to remove a thought by its_id
/api/thoughts/:thoughtId/reactions
POST
to create a reaction// example data { "reactionBody":"Hell Yeah!!", "username":"lernantino" }
/api/thoughts/:thoughtId/reactions/:reactionId
DELETE
remove a reaction by thereactionId
This project is under no license.
Please reach out to me at mflanigantwualumn@gmail.com