This app contains all of the endpoints needed for:
- React Curriculum Checkpoints
This server stores everything in-memory, so every time you restart the server, you get a clean slate.
git clone https://github.com/gSchool/collective-api.git
cd collective-api
npm install
npm start
Then you can see the API running on http://localhost:8082
- GET:
http://localhost:8082/api/products
- GET:
http://localhost:8082/api/items
- GET (all books) / POST (add book):
http://localhost:8082/api/books
- DELETE:
http://localhost:8082/api/books/:id
- PATCH (add book to cart):
http://localhost:8082/api/books/cart/add/:id
- PATCH (remove book from cart):
http://localhost:8082/api/books/cart/remove/:id
- GET (all messages):
http://localhost:8082/api/messages
- PATCH (updates multiple messages, see API for req.body requirements):
http://localhost:8082/api/messages
{
"messageIds": [1,2,3],
"command": "read",
"read": true
}
-
GET (all posts) /POST (add post):
http://localhost:8082/api/posts
-
DELETE:
http://localhost:8082/api/posts/:id
-
GET (up-vote):
http://localhost:8082/api/posts/votes/increase/:id
-
GET (down-vote):
http://localhost:8082/api/posts/votes/decrease/:id
-
GET (all comments) / POST (add comment):
http://localhost:8082/api/comments
-
DELETE:
http://localhost:8082/api/comments/:id
- GET (all users):
http://localhost:8082/api/users
- POST (add user):
http://localhost:8082/api/users
- POST (user login):
http://localhost:8082/api/login
(REQUIRES USER EMAIL AND PASSWORD)