- Clone the repo
npm install
- Start a local mongodb instance. You can run it in a docker container or just download mongodb from their website.
npm start
Mongodb in docker:
docker pull mongo
docker run --name some-mongo -p 27017:27017 -d mongo
A request will be authenticated if it contains an x-access-token
header with a valid jwt access token issued by the login or signup endpoints. Access tokens are valid for 10 minutes (feel free to change this during development).
All errors returned in the responses are generated via Boom. If a request payload is missing a required key, the error will be a 400 with the message Invalid request payload input.
Minimum 8 characters, contains a lowercase and an uppercase letter and a number.
Creates a User.
Authenticated: false
Request format: application/x-www-form-urlencoded
Request payload:
email: string, required
name: string, required,
password: passwordSchema, required
Response format: application/json
Response payload:
jwt: string (short term access token)
refresh_token: string (refresh token)
Logs in a user.
Authenticated: false
Request format: application/x-www-form-urlencoded
Request payload:
email: string, required
password: passwordSchema, required
Response format: application/json
Response payload:
jwt: string (short term access token)
refresh_token: string (refresh token)
Refreshes an expired access token.
Authenticated: Yes (expired tokens are accepted)
Request format: application/x-www-form-urlencoded
Request payload:
refresh_token: string, required
Response format: application/json
Response payload:
jwt: string (short term access token)
Logs out a user.
Authenticated: Yes
Request format: application/x-www-form-urlencoded
Request payload:
refresh_token: string, required
Response format: 204 No Content
Returns current user information.
Authenticated: Yes
Response format: application/json
Response payload:
name: string
email: string
avatar_url: string