API-Referenz
Cuby bietet eine REST-API für die programmgesteuerte Steuerung. Der Server läuft standardmäßig auf Port 3847.
Base URL
http://localhost:3847/apiREST-Endpoints
Health
| Method | Endpoint | Beschreibung |
|---|---|---|
| GET | /api/health | Health Check — gibt den Status des Cuby-Servers zurück |
Konfiguration
| Method | Endpoint | Beschreibung |
|---|---|---|
| GET | /api/config | Aktuelle Konfiguration abrufen |
| POST | /api/config/apikey | API-Key speichern |
Marketplace
| Method | Endpoint | Beschreibung |
|---|---|---|
| GET | /api/marketplace/products | Verfügbare Produkte aus dem Marketplace abrufen |
Installation
| Method | Endpoint | Beschreibung |
|---|---|---|
| POST | /api/install | Installation eines Produkts starten |
Produkte
| Method | Endpoint | Beschreibung |
|---|---|---|
| GET | /api/products/status | Status aller installierten Produkte abrufen |
Socket.IO Events
Cuby bietet Socket.IO Events für Echtzeit-Updates. Verbinden Sie sich mit dem Socket.IO-Server auf dem gleichen Port wie die REST-API.
Verfügbare Events
| Event | Richtung | Beschreibung |
|---|---|---|
product:status | Server → Client | Status-Update eines Produkts |
product:log | Server → Client | Log-Ausgabe eines Produkts |
install:progress | Server → Client | Fortschritt einer Installation |
install:complete | Server → Client | Installation abgeschlossen |
Beispiel
import { io } from "socket.io-client";
const socket = io("http://localhost:3847");
socket.on("product:status", (data) => {
console.log("Status update:", data);
});
socket.on("product:log", (data) => {
console.log("Log:", data);
});