API for all hello world programming languages.
The API url is https://start-express-ts-marj4n.vercel.app/api
and the following endpoints are available:
- POST
/auth/register
- Register a new user.
Required fields: username
, email
, password
Example request body:
{
"email": "jokowi@gmail.com",
"password": "jokowi12345",
"username": "jokowi"
}
- POST
/auth/login
- Login a user.
Required fields: email
, password
Example request body:
{
"email": "jokowi@gmail.com",
"password": "jokowi12345"
}
- GET
/auth/logout
- Logout a user.
Description: Only authenticated users can logout.
- GET
/users
- Get all users.
Description: Only authenticated users can get all users.
- GET
/users/:id
- Get a user by id.
Description: Only Authenticated users can get a user by id.
Url example: http://localhost:8080/api/users/2
- PATCH
/users/:id
- Update a user by id.
Description: Only the user's owner can update the user.
Url example: http://localhost:8080/api/users/2
Required fields: username
Example request body:
{
"username": "Jamashin"
}
- DELETE
/users/:id
- Delete a user by id.
Description: Only the user's owner can delete the user.
Url example: http://localhost:8080/api/users/2