This is a generic backend. It is intended to be a template for the creation of node backends with database provided by mongodb and object modelling provided by mongoose.
All routes are fully tested with jest.
takes a username and password in the body and returns a json web token (JWT) in res.body.token. This can then be used to authorise and provide access to the endpoints in the /api.
takes a username and password and creates a new user with that username and password. The password is encryted (salted and hashed) using bcrypt before being stored in the database. A 201 status is returned upon success. The password must contain 8 characters, at least 1 lowercase 1 uppercase 1 number 1 special.
All of these routes are secured with JWT authorization.
This supplies a summary in json format of the endpoints. At least it should do.
Upon submission of valid token in Authorization header ("Bearer TOKEN") an array of users is returned.
User's details are returned with valid username, otherwise 404 error.