Install locally with npm:
npm install
Run local tests using npm:
npm test
Clients can create a User by sending an HTTP POST request:
- Route: /signup
- Headers: none
- Body:
- Required
- Content-Type: JSON
- { "username": STRING, "password": STRING }
- Response:
- Status: 201
- Content-Type: JSON
- { "username": STRING, "id" STRING, "token": STRING }
Clients can fetch a User by sending an HTTP POST request:
- Route: /signin
- Headers:
- required:
- "Authorization" :
Basic BASE64-ENCODED-STRING
- "Authorization" :
- required:
- Body: none
- Response:
- Status: 200
- Content-Type - JSON
- { "username": STRING, "id" STRING, "token": STRING, }
As a User, I can authenticate with a Username and password, so that I can perform operations on my data
Clients can authenticate API requests using an authentication header:
- Route:
api/* - Headers:
- Required
- "Authorization":
Basic BASE64-ENCODED-STRING
Any request to the API with the above header should be authenticated by middleware.
Clients can authenticate API requests using a JSON web token:
- Route:
api/* - Headers:
- Required
- "Authorization":
Bearer JSON-WEB-TOKEN
Any request to the API with the above header should be authenticated by middleware.
Clients with the following authorized roles can perform specific request types:
-
UserRole:- Route:
- GET
api/* - POST `api/*
- GET
- Headers:
- Required
- "Authorization":
Bearer JSON-WEB-TOKEN
- "Authorization":
- Optional
- "Authorization":
Basic BASE64-ENCODED-STRING
- "Authorization":
- Required
- Response:
- 200 - authorized
- 401 - unauthorized
- Route:
-
AdminRole:- Route:
- GET
api/* - POST
api/* - PUT
api/* - DELETE
api/*
- GET
- Headers:
- Required
- "Authorization":
Bearer JSON-WEB-TOKEN
- "Authorization":
- Optional
- "Authorization":
Basic BASE64-ENCODED-STRING
- "Authorization":
- Required
- Response:
- 200 - authorized
- 401 - unauthorized
- Route: