Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| de:modul:ffit:3-jahr:cicd:learningunits:lu10:a [2026/04/28 15:24] – apeter | de:modul:ffit:3-jahr:cicd:learningunits:lu10:a [2026/04/28 17:41] (aktuell) – apeter | ||
|---|---|---|---|
| Zeile 25: | Zeile 25: | ||
| ==== Static vs dynamic hosting ==== | ==== Static vs dynamic hosting ==== | ||
| - | ^ Static hosting ^ Dynamic hosting ^ | + | Ob etwas statisch deploybar ist, hängt nicht von den Features ab, sondern davon, ob der Server zur Laufzeit am Rendering beteiligt ist. |
| - | | | | | + | |
| + | Es ist also eine Architekturfrage, | ||
| + | |||
| + | Salopp gesagt, können die meisten Webapplikationen in ein statisches Frontend und ein (allfälliges) dynamisches Backend aufgeteilt werden. | ||
| + | |||
| + | Statische Webseiten sind möglich bei | ||
| + | * Vanilla | ||
| + | * Angular | ||
| + | * React | ||
| + | * Vite | ||
| + | * Astro (default) | ||
| + | |||
| + | Ausnahmen sind | ||
| + | * PHP | ||
| + | * .php | ||
| + | * Next.js mit API/SSR | ||
| + | * getServerSideProps | ||
| + | * Routing (route.js, route.ts, "/ | ||
| + | * NextResponse | ||
| + | * cookies() | ||
| + | * headers() | ||
| + | * Express mit Templates | ||
| + | * .ejs | ||
| + | * .pug | ||
| + | * .hbs | ||
| ==== Next.js ==== | ==== Next.js ==== | ||
| + | |||
| + | '' | ||
| <code javascript> | <code javascript> | ||
| const nextConfig = { | const nextConfig = { | ||
| Zeile 37: | Zeile 62: | ||
| module.exports = nextConfig; | module.exports = nextConfig; | ||
| </ | </ | ||
| + | |||
| + | Nach dem erfolgreichen Ausführen von folgendem Befehl, sind die fertigen Dateien unter ''/ | ||
| <code bash> | <code bash> | ||
| npm run build | npm run build | ||
| </ | </ | ||
| + | |||
| + | <code bash> | ||
| + | npx serve out | ||
| + | </ | ||
| + | |||
| + | Mögliche Fehler: | ||
| + | * „Route Handlers are not supported with output: export“ | ||
| + | * „Dynamic server usage“ | ||
| + | |||