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! 🦉✨
67 lines
1.4 KiB
Markdown
67 lines
1.4 KiB
Markdown
# 📡 Crumbforest API – Erste `curl`-Beispiele
|
||
|
||
Willkommen kleiner Krümel! 🌲 Hier findest du Beispiele, wie du dem Crumbforest Terminal per `curl` Befehle senden kannst.
|
||
|
||
---
|
||
|
||
## 📦 Ziel-API
|
||
**URL:** `http://localhost:8080/crumbapi/blockly-terminal`
|
||
**Methode:** `POST`
|
||
**Content-Type:** `application/json`
|
||
|
||
---
|
||
|
||
## ✅ Beispiel 1 – Einfache Nachricht senden
|
||
|
||
```bash
|
||
curl -X POST http://localhost:8080/crumbapi/blockly-terminal \
|
||
-H "Content-Type: application/json" \
|
||
-d '{"blockcode": "window.alert(\"Wuhuuuu\")"}'
|
||
```
|
||
|
||
---
|
||
|
||
## 🧪 Beispiel 2 – Blockly-Code mit Zeilenumbruch
|
||
|
||
```bash
|
||
curl -X POST http://localhost:8080/crumbapi/blockly-terminal \
|
||
-H "Content-Type: application/json" \
|
||
-d '{"blockcode": "window.alert('Hello');\nconsole.log('Hi');"}'
|
||
```
|
||
|
||
---
|
||
|
||
## 🚫 Fehlerquelle
|
||
|
||
Wenn du `curl http://localhost:8080/crumbapi/blockly-terminal` OHNE `-X POST` verwendest, bekommst du:
|
||
|
||
```
|
||
Error: Method Not Allowed
|
||
```
|
||
|
||
Das liegt daran, dass diese Route **nur POST-Anfragen** erlaubt!
|
||
|
||
---
|
||
|
||
## 📁 Vorschlag für Shell-Skript
|
||
|
||
Erstelle dir eine kleine Datei `crumbblock_post.sh`:
|
||
|
||
```bash
|
||
#!/bin/bash
|
||
CODE="$*"
|
||
curl -s -X POST http://localhost:8080/crumbapi/blockly-terminal \
|
||
-H "Content-Type: application/json" \
|
||
-d "{\"blockcode\": \"$CODE\"}"
|
||
```
|
||
|
||
Dann kannst du direkt schreiben:
|
||
|
||
```bash
|
||
./crumbblock_post.sh "window.alert('Hallo Krümel!')"
|
||
```
|
||
|
||
---
|
||
|
||
🕊️ Viel Spaß beim Senden deiner ersten Blockly-Krümel!
|