API Documentation

Base URL

Loading...

GET

/messages
Retrieves all messages from the database.

Response:

[ { "ID": 1, "Text": "Hello", "Author": "Alice" }, ... ]

GET

/totalMessages
Returns the total number of messages.

Response:

42

POST

/newMessage
Creates a new message.

Request Body:

{"Text": "Hello", "Author": "Alice"}

Response:

{"message": { "ID": 1, "Text": "Hello", "Author": "Alice" }}

Error Response:

{"error": "Text and Author are required"}

GET

/uptime
Returns the uptime of the server since it started.

Response:

{"uptime": "2h45m30s"}

Static Assets (like this page)

Static files are served from the assets directory.

Other Pages

View Messages GitHub