Skip to content

Backend Routes

Chris Vo edited this page Jan 6, 2020 · 3 revisions

HTML

  • GET / StaticPagesController#root

API Endpoints

Users

  • GET /api/users/user - show current user's information
  • POST /api/users - sign up

Session

  • POST /api/session - log in
  • DELETE /api/session - log out

Servers

  • GET /api/servers - shows all servers affiliated with current user
  • GET /api/servers/:serverId - shows a server and its content
  • POST /api/servers - creates a new server
  • PATCH /api/servers/:serverId - edit an existing server
  • DELETE /api/servers/:serverId - delete an existing server

Channels

  • GET /api/servers/:serverId/channels - shows all channels affiliated with a server
  • GET /api/servers/:serverId/channels/:channelId - shows a channel and its content
  • POST /api/servers/:serverId/channels - create a new channel
  • PATCH /api/servers/:serverId/channel/:channelId - edit an existing channel
  • DELETE /api/servers/:serverId/channel/:channelId - delete an existing channel

Messages

  • GET /api/servers/:serverId/channels/:channelId/messages - shows all messages affiliated with a server
  • POST /api/servers/:serverId/channels/:channelId/messages - write a new message
  • PATCH /api/servers/:serverId/channels/:channelId/messages/:messageId - edit an existing message (only current user can edit their own message)
  • DELETE /api/servers/:serverId/channels/:channelId/messages/:messageId - delete an existing message (only current user can delete their own message. Server owners can delete any message)

Direct Messages

  • GET /api/directmessages - show all direct messages
  • POST /api/directmessages - create a new message
  • PATCH /api/directmessages/:directmessageId - edit an existing message (only current user can edit their own message)
  • DELETE /api/directmessages/:directmessageId - delete an existing message (only current user can delete their own message)
Clone this wiki locally