WinRate is a responsive, full-stack app that lets users journal their board-gaming sessions and view statistics about their gaming history.
This repo contains the back-end API for WinRate. The front-end (React) client is located here.
git clone https://github.com/MattLong87/winrate-api.git
cd winrate-api
npm install
node server.js
npm test
- When user is created or logs in with username and password, token is generated and returned.
- Future requests supply token in header:
Authorization: Bearer {token}
POST /api/login
Required body fields:
- password
POST /api/users
Required body fields:
- password
- firstName
- lastName
GET /api/users/me
POST /api/users/me/add-sessions
Required body fields:
- game (string)
- players (array)
- winner (string)
- date (string)
DELETE /api/users/me/sessions
Required body fields:
- sessionId