Backend Routes - maxbildner/coinspace GitHub Wiki

Backend Routes

  # GET / (home page)
  root 'static#root' 

  
  namespace :api, defaults: { format: :json } do
    # POST api/user (create user)
    resources :users, only: [:create]

    # POST api/session (log in)
    # DELETE api/session (logout)
    resource :session, only: [:create, :destroy]

    # GET api/currencies (list all currencies)
    # GET api/currency/:id (show currency information)
    resources :currencies, only: [ :index, :show ]

    # POST api/wallet_transactions (create new wallet transaction AND update wallet value, AND user cash balance)
    # 1st argument after resources needs to match front end ajax request url?
    resources :wallet_transactions, only: [ :create ]

    # To Implement:
    # GET api/watchlists (retrieve all watchlist items)
    # POST api/watchlists (create new watchlist item)
    # DELETE api/watchlists/:id (remove watchlist item)
    resources :watchlists, only: [ :index, :create, :destroy ]
  end