Skip to content

ofluffydev/the-room

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Room

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.

Setup

API Endpoints

Get all messages

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.

Get the last X amount of messages

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

Send a message

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!"
}

About

Simple chat room API in rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published