Poke Test server/client. Server is ExpressJS/Typecript. Client is CRA bootstrapped
using prop-types
.
git pull https://github.com/gumacahin/poketest
See API documentation below. To start do the server:
cd server
npm i
npm run build
npm run test
npm run start
cd client
npm i
npm run start
API Server is an expressjs app. All endpoints except login requires an 'Authorization' header contaning the username of the current user.
API POST/PUT requires JSON in the req.body.
Param: { username: <username> }
Creates a user with . Returning user object. If user does not exists it is created.
Resolves to items available in the shop.
Resolves the current user's items
Param: {itemId: <item id of item being purchased>}
Purchases an item for the current user. Resolves to error if funds are insufficient.
Resolves the current user's pokemons
Param: {name: <item id of item being purchased>}
Update current user's pokemon nickname. Resolves to pokemon object
Resolves to current user.