31 lines
729 B
Markdown
31 lines
729 B
Markdown
|
|
# API Reference
|
||
|
|
|
||
|
|
Endpunkte, die `web/serve.py` bereitstellt.
|
||
|
|
|
||
|
|
## GET `/` und `/index.html`
|
||
|
|
|
||
|
|
Liefert das Frontend aus `web/index.html`.
|
||
|
|
|
||
|
|
## GET `/templates.json`
|
||
|
|
|
||
|
|
Liefert den Template-Katalog aus `web/templates.json` (JSON).
|
||
|
|
|
||
|
|
## GET `/templates/<pfad>`
|
||
|
|
|
||
|
|
Liefert die Datei unter `<ROOT>/templates/<pfad>`.
|
||
|
|
|
||
|
|
- `.md` → Content-Type `text/plain`
|
||
|
|
- sonst → Content-Type `application/json`
|
||
|
|
|
||
|
|
Fehler: `404` wenn die Datei nicht existiert.
|
||
|
|
|
||
|
|
## PUT `/templates/<pfad>`
|
||
|
|
|
||
|
|
Speichert den Request-Body in `<ROOT>/templates/<pfad>` (bzw. `web/templates.json` für `/templates.json`).
|
||
|
|
|
||
|
|
- Content-Type muss `text/*` sein.
|
||
|
|
- Das Ziel-Verzeichnis muss existieren (sonst `404`).
|
||
|
|
- Content-Length > 0 (sonst `400`).
|
||
|
|
|
||
|
|
> Stub — noch auszuarbeiten.
|