bhwong11 / points-take-home

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

works on local machine with port of 4000, all information is returned in JSON data

3 routes are avaliable

/addtransaction
expects "payer":string, "points":number, and "timestamp":string (will be converted to date when saved) in the request body as JSON
returns string of "successfully added transaction" or "not enough in payer account for this transaction"
this will also add the transaction to as an object to memory in the server

/acounts
returns each individual payer and their current point totals as an array of objects

/spend
expects "spend":number in the request body as JSON
returns amount spent by each user as a negative number(if zero spend, will return zero) as an array of objects
nothing is expected in the request body

About


Languages

Language:JavaScript 100.0%