A small API project that serves a chat room with 0 authenticating and log in.
Build with Rust using Actix and Diesel.
It is configured to use pools to manage the database connections, since Diesel does not support async yet.
This means the schema generated by Diesel isn't even used, but it still can use diesel migration run
to create the database.
You can get all the messages in the chat room by sending a GET request to the /messages
endpoint.
GET /messages
You typically will use the last query parameter to specify the number of messages you want to get as shown below.
You can get the last X amount of messages by sending a GET request to the /messages
endpoint with the last query parameter.
GET /messages?last=10
This is a very simple POST request to send a message to the chat room.
POST /messages
Content-Type: application/json
{
"username": "John Doe",
"message": "Hello, World!"
}