A note service with JWT authentication and MySQL data base
Below are described the REST endpoints available that you can use to handle notes
First of all you will need create a new user
http://localhost:4000/signup
http://localhost:4000/login
With the next body:
{
"username": "mike",
"password": "password"
}
This will provide you with:
- A JWT that you will have to save and send in each request
- Username of the logged user
⚠️ Send the JWT in each request through the header "Authirization"
http://localhost:4000/api/notes/
- Send username through the header "username"
http://localhost:4000/api/notes/
With the next body:
{
"title": "title",
"content": "note content",
"user": {
"username": "username"
}
}
http://localhost:4000/api/notes/(noteId)
http://localhost:4000/api/notes/(noteId)
With the next body:
{
"title": "xd",
"content": "date now",
"user": {
"username": "mike"
}
}
http://localhost:4000/api/notes/search?query=(query)
- Send username through the header "username"