Backend Routes - SilentNN/Affinity GitHub Wiki
Backend Routes
HTML
GET /
StaticPagesController#root
API Endpoints
users
GET /api/users
- returns user info
GET /api/users/:id
- returns user info
POST /api/users
- sign up
PATCH /api/users/:id
- edit user information - avatar, email, password, etc.
DELETE /api/users/:id
- destroy account
session
POST /api/session
- sign in
DELETE /api/session
- sign out
servers
GET /api/servers
- returns server list
POST /api/servers
- create a new server, and makes the user a member and server owner of it
PATCH /api/servers/:id
- edit server info
DELETE /api/servers/:id
- destroy server
channels
GET /api/servers/:server_id/channels
- returns channels of a server
POST /api/servers/:server_id/channels
- create a new channel in a server
PATCH /api/channels/:id
- edit channel
DELETE /api/channels/:id
- destroy channel
messages
GET /api/channels/:channel_id/messages
- return last 50 messages of a channel
POST /api/channels/:channel_id/messages
- create new message in a channel
PATCH /api/messages/:message_id
- edit message
DELETE /api/messages/:message_id
- delete message