| Crates.io | ferris_chats_server |
| lib.rs | ferris_chats_server |
| version | 0.1.1 |
| created_at | 2025-01-18 05:25:33.252156+00 |
| updated_at | 2025-01-19 19:23:20.552729+00 |
| description | This binary provides a server for ferris_chat. |
| homepage | |
| repository | https://github.com/TuxMC-sys/ferris_chats/ |
| max_upload_size | |
| id | 1521374 |
| size | 35,610 |
This binary is the server for Ferris Chat and can be used standalone.
By default, this server is hosted on 0.0.0.0 on port 3000. A configuration file system will be added at some point.
This is unsecured and uses http. WIP.
How you retrieve messages.
The following routes are provided for GET requests:
/{first}/{amount} amount messages after the first specified message. If the request is non-numeric, negative, or includes
messages that don't exist, it will return a 400 Error/time/{time}time. The variable time should be in the format prescribed by RFC3339, which
should look something like "2012-12-12T12:12:12Z". If the format is wrong, you'll receive an error 400, otherwise, if the requested
messages don't exist, you'll receive an error 404./all/countFor endpoints except for /count, you will receive the a JSON object in the following format:
{"messages": [*message objects*]}
If there are message objects, they will be in the following format, seperated by commas:
{"content": "Message body",
"author": "'Unknown' or the author.",
"time": "Time message was recieved in RFC3339 format},
How you send messages
The following endpoint is provided for POST requests:\
\endpointContent-Type of application/json.A received message must contain at least the following:
{"content": "Message Body"}
and should have a body as follows:
{"content": "Message Body", "author": "Author"}
This is a work in progress. If you find bugs, please let me know. Also, once ran, you need to hit ctrl+c to exit and save.
Messages are saved in $PATH/.ferris_chats/messages.json.