Database Schema & Backend Routes - g-wn/rungs GitHub Wiki

Users
-
GET
/api/users- Returns the information for all users.
-
GET
/api/users/:userId- Returns the information for one user.
-
GET
/api/session/current- Returns the information for the logged-in user.
-
POST
/api/session/signup- Signs up a new user.
-
POST
/api/session/login- Logs in a user.
-
DELETE
/api/session/current- Logs out a user.
Posts
-
GET
/api/posts- Returns the posts from users in the current user's network.
-
POST
/api/posts- Creates a new post.
-
PUT
/api/posts/:postId- Updates a post if owned by the current user.
-
DELETE
/api/posts/:postId- Removes a post if owned by the current user.
Network
-
GET
/api/network- Returns all of the users in the current user's network.
-
POST
/api/network/:userId- Sends a request to another user, and upon acceptance, adds that user to the current user's network.
-
DELETE
/api/network/:userId- Removes a user from the current user's network.