This project is a REST API built with TypeScript and Express.js that exposes machine data as JSON. It can be run as a local Docker container.
To run the application as a local Docker container, follow these steps:
-
Make sure you have Docker installed on your machine.
-
Build the Docker image by running the following command in the project root directory:
docker compose up --build
-
The API will be accessible at
http://localhost:3000/api/v1
and the WebSocket atws://localhost:4000
. -
A sample connection to the Websocket is implemented under ws-connect->wsConnection.js.
-
Shut the Docker container down by running the following command in the project root directory:
docker compose down
The API exposes the following endpoints:
GET /machines
: Retrieves all machines and their status.GET /machines/:id
: Retrieves the event history for one specific machine identified by the UUID.
Please refer to the source code for more details on the request and response formats.