Skip to content

API Endpoints

Jonny edited this page Mar 12, 2019 · 2 revisions

Endpoints

Our api is located on the route /api, not the root /, so keep that in mind. /login is really /api/login.

GET /

  • Ping route to wake up the Heroku instance

POST /login

  • Login endpoint
  • Input: email, password
  • Response: token, user_id, provider
  • Description: Logs a user in, and returns a boolean whether the user is a provider or not

POST /users

  • Registration endpoint
  • Input: email, password
  • Description: The server will hash your password and generate a user. Email tokens are commented out.

GET /users/:user_id

  • Get user by ID

PUT /users/:user_id

  • Update user by ID

DELETE /users/:user_id

  • Delete user by ID

POST /users/verify/:user_id

  • Verify user's email

POST /posts

  • Submit a post

GET /posts

  • Get all posts

DELETE /posts/

  • Delete a post

Clone this wiki locally