12 Monate Crumbforest-Wachstum, sortiert nach Waldlogik. Struktur: - 454 Dokumente in 7 organischen Ebenen - Lichtung → Waldrand → Waldmitte → Wurzeln → Krone → Unterholz → Samen - INDEX.md für jede Ebene (eigene Stimme) - WALDKARTE.md (Master-Navigation) - crumbcodex.md (Das Versprechen zwischen Krümel & Bits) - lichtung/willkommen.md (Nullfeld-Einstieg für Kinder) Philosophie: - Waldlogik statt Ordnerlogik - Tiefe, Licht, Wurzeln - wie ein echter Wald - Schutz für Krümel, Tiefe für Gräber, Poesie für Atmende Repos verbunden: - OZM-Keks-Handbuch-v1 (Das Wissen) - Crumb-Core-v.1 (Das Herz) - 194.164.194.191 - crumbmissions (Das Spiel) Wuuuhuuuuu! 🦉✨
77 lines
2.0 KiB
Markdown
77 lines
2.0 KiB
Markdown
# crumbblock_post_handbuch.md
|
|
|
|
📦 **Crumbforest Blockly-API Handbuch**
|
|
|
|
---
|
|
|
|
## 🔍 Ziel
|
|
|
|
Sende aus dem Terminal-Container (`robot@...`) einen Blockly-Code-Schnipsel an die CakePHP-API im App-Container.
|
|
|
|
---
|
|
|
|
## 🧨 Problem
|
|
|
|
Wenn du im Terminal-Container `curl http://localhost/crumbapi/blockly-terminal` verwendest, bekommst du:
|
|
|
|
```
|
|
curl: (7) Failed to connect to localhost port 80: Connection refused
|
|
```
|
|
|
|
**Grund**: Der App-Server läuft **nicht im gleichen Container**, sondern separat.
|
|
|
|
---
|
|
|
|
## ✅ Lösungsmöglichkeiten
|
|
|
|
### 🟩 Option 1: Zugriff über Container-Name (empfohlen bei Docker `bridge` Netzwerk)
|
|
|
|
Ersetze `localhost` im `curl`-Befehl durch den Containernamen:
|
|
|
|
```bash
|
|
curl -X POST http://kuchenwald_docker_php83_sql_mit_auth_mit_composer_update_v1_rcv06-app-1/crumbapi/blockly-terminal -H "Content-Type: application/json" -d '{"blockcode": "window.alert(\"test\")"}'
|
|
```
|
|
|
|
### 🟦 Option 2: Zugriff über `host.docker.internal` (nur unter macOS/Windows)
|
|
|
|
```bash
|
|
curl -X POST http://host.docker.internal:8080/crumbapi/blockly-terminal -H "Content-Type: application/json" -d '{"blockcode": "window.alert(\"test\")"}'
|
|
```
|
|
|
|
---
|
|
|
|
## 🧪 Erwartete Antwort
|
|
|
|
```json
|
|
{
|
|
"status": "success",
|
|
"message": "Blockcode received.",
|
|
"received": "window.alert("test")"
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## 🎯 Integration ins Missionszentrum (mission_selector_mission_1.sh)
|
|
|
|
Passe den Abschnitt `case 4)` folgendermaßen an:
|
|
|
|
```bash
|
|
4)
|
|
echo ""
|
|
echo "📡 Sende Beispielcode an Crumbforest API..."
|
|
curl -s -X POST http://kuchenwald_docker_php83_sql_mit_auth_mit_composer_update_v1_rcv06-app-1/crumbapi/blockly-terminal -H "Content-Type: application/json" -d '{"blockcode": "window.alert(\"test\")"}'
|
|
;;
|
|
```
|
|
|
|
---
|
|
|
|
## 🧁 Hinweis für die Ausgabe
|
|
|
|
Wenn der `curl`-Befehl erfolgreich war und `-s` (silent) verwendet wurde, erscheint keine sichtbare Antwort.
|
|
Wenn du die Rückmeldung sehen willst, entferne das `-s` in `curl`.
|
|
|
|
---
|
|
|
|
🕊️ **Krümelkommunikation funktioniert, wenn die Container sich zuhören.**
|