An api for a hypothetical social network built with MongoDB and Mongoose.
Table of Contents
You'll need Node.js, npm, and MongoDB to be installed before you begin. Clone this repo. From your command line, go to the repo directory and run npm install
.
With that out of the way, you can run npm start
to start the server.
You can hit the endpoints to perform CRUD actions for users, thoughts, and reactions.
Endpoint: /api/users
GET
all usersPOST
a new user:
{
"username": "kramer",
"email": "kramer@example.com"
}
Endpoint: /api/users/userID
GET
a single userDELETE
a single user AND all associated thoughtsPUT
update a user with a new username or email:
{
"email": "cosmo.kramer@example.com"
}
Endpoint: /api/users/userID/friends/friendID
POST
add a new friend to a user's friend listDELETE
remove a friend from a user's friend list
Endpoint: /api/thoughts
GET
get all thoughts
POST
create a new thought:
{
"username": "newman",
"thoughtText": "Hello, Jerry."
}
Endpoint: /api/thoughts/thoughtID
GET
a single thoughtPUT
update a thought's thoughtText:
{
"thoughtText": "Hello, ~Jerry~"
}
DELETE
remove a thought
Endpoint: /api/thoughts/thoughtID/reactions
POST
creates a reaction to a thought and stores it in the parent thought'sreactions
arrayDELETE
removes a reaction by its reactionId:
{
"reactionId": "62fec182d2e24bc9bbd6ab5d"
}
antisocial-network-api-demo.mp4
This project uses the Hippocratic License, v3.0. TL;DR, it's not quite open source, but as long as you're not violating human rights, being a fossil fuel company, conducting military operations, etc (see license for full details), you can essentially treat it as open source.
Contact lshillman via methods described at lukehillman.net.