Skip to content

Commit 1e151cb

Browse files
authored
Update README.md
1 parent fed8af0 commit 1e151cb

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,62 @@ In the world of social gatherings and potlucks the "Potluck Planner" is king. Th
4545

4646

4747
![](component-hierarchy.png)
48+
49+
50+
51+
---
52+
---
53+
54+
# Backend:
55+
56+
# Potluck Planner API
57+
58+
Hosted Backend URL: https://potluck-planner1.herokuapp.com/
59+
60+
Endpoints that require an authorization token:
61+
62+
Headers:
63+
| Key | Value |
64+
| :-- | :-- |
65+
| Authorization | AUTH_TOKEN |
66+
67+
## Authentication
68+
69+
| Method | Endpoint | Requirements | |
70+
| ------ | -------------- | ------------------------ | ------------------ |
71+
| POST | /auth/register | name, username, password | Creates a new user |
72+
| POST | /auth/login | username, password | Logs in users |
73+
74+
## Users
75+
76+
| Method | Endpoint | Requirements | |
77+
| ------ | -------------- | --------------------------------------- | ------------------------- |
78+
| GET | /api/users | | Returns all users |
79+
| GET | /api/users/:id | | Returns user object by id |
80+
| PUT | /api/users/:id | either name, username, password, or all | Updates the user by id |
81+
| DELETE | /api/users/:id | | Deletes the user by id |
82+
83+
## Events
84+
85+
| Method | Endpoint | Requirements | |
86+
| ------ | ---------------------- | ------------------------------------------------------- | --------------------------------------------------------------- |
87+
| GET | /api/events | | Returns all events |
88+
| GET | /api/events/users/:id | | Returns all events related to user id, returns data of event id |
89+
| GET | /api/events/:id | | Returns event by id |
90+
| GET | /api/events/:id/food | | Gets food for event id |
91+
| GET | /api/events/:id/guests | | Gets all guests by event id |
92+
| POST | /api/events | title, location, month, day, year, start_time, end_time | Creates new event |
93+
| POST | /api/events/:id/guests | userID (of the user being added) | Add guest to event by id |
94+
| PUT | /api/events/:id | title, location, month, day, year, start_time, end_time | Updates event by id |
95+
| DELETE | /api/events/:id | | Deletes event by id |
96+
97+
## Food
98+
99+
| Method | Endpoint | Requirements | |
100+
| ------ | -------------------- | --------------------------------------------------------------------- | -------------------------------- |
101+
| GET | /api/food | | Returns all food items |
102+
| GET | /api/events/:id/food | | Returns all the food by event id |
103+
| GET | /api/food/:id | | Returns food object by id |
104+
| POST | /api/food | eventId, userID(of person bringing, optional), category, quantity, name (must be unique) | Creates new food object |
105+
| PUT | /api/food/:id | eventId, userID(of person bringing, optional), category, quantity , name (must be unique) | Updates the food by id |
106+
| DELETE | /api/food/:id | | Deletes the food by id" |

0 commit comments

Comments
 (0)