Skip to Content
CubyAPI-Referenz

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/api

REST-Endpoints

Health

MethodEndpointBeschreibung
GET/api/healthHealth Check — gibt den Status des Cuby-Servers zurück

Konfiguration

MethodEndpointBeschreibung
GET/api/configAktuelle Konfiguration abrufen
POST/api/config/apikeyAPI-Key speichern

Marketplace

MethodEndpointBeschreibung
GET/api/marketplace/productsVerfügbare Produkte aus dem Marketplace abrufen

Installation

MethodEndpointBeschreibung
POST/api/installInstallation eines Produkts starten

Produkte

MethodEndpointBeschreibung
GET/api/products/statusStatus 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

EventRichtungBeschreibung
product:statusServer → ClientStatus-Update eines Produkts
product:logServer → ClientLog-Ausgabe eines Produkts
install:progressServer → ClientFortschritt einer Installation
install:completeServer → ClientInstallation 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); });