This project provides RESTful APIs for managing users.
To run the application, execute the DemoApplication.java
class.
- Endpoint:
POST http://localhost:8080/users
- Description: Creates a new user.
- Request Body:
{
"username": "user_name",
"email": "user_name@example.com"
}
- Example Request:
POST http://localhost:8080/users
Body:
{
"username": "abcd",
"email": "abcd@example.com"
}
- Endpoint:
GET http://localhost:8080/users/{id}
- Description: Retrieves the user with the specified ID.
- Example Request:
GET http://localhost:8080/users/1
- Endpoint:
GET http://localhost:8080/users
- Description: Retrieves all users.
- Endpoint:
DELETE http://localhost:8080/users/{id}
- Description: Deletes the user with the specified ID.