-
-
Notifications
You must be signed in to change notification settings - Fork 61
Routes & Endpoints
Manuel edited this page Oct 31, 2023
·
17 revisions
The following are the current routes found in app.js on the back-end:
-
Home route:
-
/
: not really used by itself.
-
-
Authentication routes:
-
POST /api/login
-> Login user. -
POST /api/user
-> Register new user.
-
-
Users routes:
-
GET /api/users
-> Get all users. -
GET /api/user/:id
-> Get specific user. -
PATCH /api/user/:id
-> Update specific user. -
DELETE /api/user/:id
-> Delete specific user. -
GET /api/users/delete-test-users
-> Delete all test users.
-
-
Friends routes:
-
GET /api/users/:userId/friends
-> Get all friends from a user - NOT WORKING YET. -
GET /friend-requests/received/:userId
-> Get pending friend requests received by the user - NOT WORKING YET. -
GET /friend-requests/sent/:userId
-> Get pending friend requests sent by the user - NOT WORKING YET. -
POST /api/friend-requests/
-> Send a friend request - NOT WORKING YET. -
POST /api/friend-requests/accept/:requestId
-> Accept a friend request - NOT WORKING YET. -
POST /api/friend-requests/reject/:requestId
-> Reject a friend request - NOT WORKING YET. -
DELETE /friends/:friendshipId
-> Unfriend a specific user - NOT WORKING YET.
-
-
Posts routes:
-
GET /api/posts
-> Get all posts. -
GET /api/post/:id
-> Get specific post. -
POST /api/post/
-> Create post. -
PATCH /api/post/:id
-> Update specific post. -
DELETE /api/post/:id
-> Delete specific post. -
GET /api/posts/delete-test-posts
-> Delete all test posts.
-
-
Events routes:
-
GET /api/events
-> Get all events. -
GET /api/event/:id
-> Get specific event. -
POST /api/event/
-> Create event. -
PATCH /api/event/:id
-> Update specific event. -
DELETE /api/event/:id
-> Delete specific event. -
GET /api/events/delete-test-events
-> Delete all test events.
-
The following are the current routes found in App.js and the components they render:
-
/
-> Timeline component - Accessible after logging in. -
/dashboard
-> Dashboard component - NOT accessible via UI. -
/settings
-> Settings component - Accessible via UI. -
/user-profile
-> UserProfile component - Accessible via UI. -
/friends
-> Friends component - Accessible via UI. -
/events
-> Events component - Accessible via UI. -
/profile
-> Profile component - Accessible via UI. -
/post
-> Post component - NOT accessible via UI. -
/terms
-> Terms component - Accessible via UI - Pretty much empty component. -
/feedback
-> Feedback component - Accessible via UI. -
/help
-> HelpCenter component - Accessible via UI. -
/admin
-> AdminDashboard component - Accessible via UI.