This is a auth service that uses JWT to authenticate users.
- Clone the repo
- Run
npm install
- Run
npm run dev
- Create a user by sending a POST request to
/api/users
with the following body:
{
"name": "John Doe",
"username": ""
"password": "password"
}
- Login by sending a POST request to
/api/auth
with the following body:
{
"username": ""
"password": "password"
}
- You will receive a JWT token in the response. Use this token to authenticate your requests by adding it to the
Authorization
header.