Skip to content

Backend Routes

keely-lee edited this page Jun 9, 2020 · 6 revisions

HTML

  • GET / StaticPagesController#root

API Endpoints

users

  • POST /api/users - user enrollment

session

  • POST /api/session - user login
  • DELETE /api/session - user logout

stocks

  • GET /api/stocks - returns the stocks owned by the logged in user (filtered by params)
  • GET /api/stocks/:id - returns selected stock
  • POST /api/stocks/ - adds a (new) purchased stock to user's list
  • PATCH /api/stocks/:id - adds/subtracts previously owned stock on user's list
  • DELETE /api/stocks/:id - removes (if sell out) stock owned by user

transactions

  • GET /api/transactions - returns list of user's transactions (may be filtered for the past 30 days)
  • POST /api/transactions/:id - adds buy/sell transactions

Note:

  • Users does not need a GET route
  • Watchlist does not need a route
  • Users' portfolios will be rendered via the /api/users/stock/ route
Clone this wiki locally