Skip to content

Backend Routes

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

HTML

  • GET / StaticPagesController#root

API Endpoints

Users

  • GET /api/users/user - show current user's information
  • POST /api/users - sign up
  • GET /api/users/find - find a user by their username
  • PATCH /api/users/:userId - edit an existing user
  • DELETE /api/users/:userId - delete an existing user

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/channels - shows all channels affiliated with a server
  • GET /api/channels/:channelId - shows a channel and its content
  • POST /api/channels - create a new channel
  • PATCH /api/channel/:channelId - edit an existing channel
  • DELETE /api/channel/:channelId - delete an existing channel

Messages

  • GET /api/messages - shows all messages affiliated with a server
  • POST /api/messages/:messageId - write a new message
  • PATCH /api/messages/:messageId - edit an existing message
  • DELETE /api/messages/:messageId - delete an existing message

Affiliations

  • POST /api/affiliations - creates a link between a user and a server
  • DELETE /api/affiliations/ - deletes a link between a user and a server

Direct Messages

  • GET /api/directmessages - show all direct messages
  • POST /api/directmessages - create a new message
  • PATCH /api/directmessages/:directmessageId - edit an existing message
  • DELETE /api/directmessages/:directmessageId - delete an existing message
Clone this wiki locally