- URL:
/api/login
- Method:
POST
- Request Body:
user
(string): Usernamepass
(string): Password
- Response:
accessToken
(string): JWT access token
- Description: Authenticate user and generate an access token( {expiresIn: "1hour"} ), Use the access token to perform Quotes operations in Bearer authentication.
- URL:
/api/refresh
- Method:
GET
- Response:
accessToken
(string): JWT access token
- Description: Refresh the access token using a valid refresh token( {expiresIn: "1day"} ). This endpoint allows the user to obtain a new access token without the need for re-authentication.
- URL:
/api/logout
- Method:
GET
- Response:
- Success:
204 No Content
- Success:
- Description: Invalidate the current user's access token and log out.
- URL:
/api/register
- Method:
POST
- Request Body:
user
(string): Usernamepass
(string): Password
- Response:
message
(string): Success message
- Description: Register a new user.
- URL:
/api/user/profile
- Method:
GET
- Response:
username
(string): Usernameroles
(array): User roles
- Description: Get the profile information of the authenticated user.
- URL:
/api/quotes
- Method:
GET
- Response:
quotes
(array): Array of quote objects
- Description: Retrieve all quotes from the database.
- URL:
/api/quotes/:id
- Method:
GET
- Response:
quote
(object): Quote object
- Description: Retrieve a quote by its ID from the database.
- URL:
/api/quotes
- Method:
POST
- Request Body:
quote
(string): Quote textcharacter
(string): Character nameanime
(string): Anime nameepisode
(string): Episode details
- Response:
message
(string): Success message
- Description: Add a new quote to the database.
- URL:
/api/quotes/
- Method:
DELETE
- Request Body:
quoteId
(string): Quote ID
- Response:
message
(string): Success message
- Description: Delete a quote from the database.