Registers a new user with a username and password.
Request Body:
{
"username": "string",
"password": "string"
}Response:
201 Created: User registered successfully.409 Conflict: User already exists.
Logs in a user with a username and password.
Request Body:
{
"username": "string",
"password": "string"
}Response:
200 OK: Login successful.401 Unauthorized: Invalid username or password.
Sends a message to a specified group.
Request Body:
{
"username": "string",
"groupName": "string",
"message": "string"
}Response:
200 OK: Message sent successfully.
Retrieves messages from a specified group.
Query Parameters:
groupName: The name of the group to retrieve messages from.
Response:
200 OK: A list of messages.
Deletes all accounts or all messages based on the type parameter.
Query Parameters:
type:accountsto delete all user accounts.msgsto delete all messages.
Response:
200 OK: Successful deletion of data.400 Bad Request: Invalidtypeparameter.
The server will start on port 8000.