Skip to content

NodeJS backend for the XTOX project. Currently hosted on cyclic.sh

Notifications You must be signed in to change notification settings

singiamtel/xtox-back

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XTOX Backend

Navigation: Website | Backend repository | Frontend repository

Default port is 8080

API Structure

Authorization

  • POST /login -> Login with username and password, get a JWT for the other endpoints
  • POST /register -> Create a new account

Free endpoints

  • GET / -> Test endpoint
  • GET /stock -> All available stocks in database
  • GET /stock/symbol -> Single stock (i.e. /stock/aapl)

Protected endpoints

  • POST /buy/:id -> Buy a stock (if you have enough money)
  • POST /sell/:id -> Sell a stock
  • GET /wallet -> See your current money and stocks owned

Environment

PORT=8080
JWT_SECRET="YOUR_JWT_SECRET"
MONGODB_URI="YOUR_MONGODB_URI""

About

NodeJS backend for the XTOX project. Currently hosted on cyclic.sh

Topics

Resources

Stars

Watchers

Forks