This is a simple server that uses signin / sign up to provide a user with a JWT token.
-
After downloading the simple-server repo,
npm i
to install all packages. -
create an
.env
file in the root directory.
Environment Variables
PORT=3000
MONGODB_URI= 'mongodb://localhost/your_mongo_db_name_here'
SECRET='your_secret_here'
-
Start up a local mongoDB server
-
npm i
ornpm run watch
expects a user object
Input
{
username: Bob,
email: Bob@Dylan.com,
password: goobledygook,
}
Output
JWT token
Input
expects basic auth in the header
Output
JWT token
Output
all users in the database.
Output
Finds a single user matching the :id
Output
Finds a single user matching the :username