Files
nodeMap/docs/guide/env.md
ISA 9a2b438eaf feat: basePath-Konfiguration von .env in config.json verschoben
basePath wird jetzt in config.json gepflegt statt als NEXT_PUBLIC_BASE_PATH in .env.*
Alle relevanten Code-Stellen lesen basePath dynamisch aus config.json
Dokumentation und Beispiele in Markdown-Dateien entsprechend angepasst
Erhöhte Flexibilität für Deployments ohne Rebuild
2025-08-20 08:42:24 +02:00

66 lines
2.7 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- /docs/guide/env.md-->
# 🌐 Umgebungsvariablen (`.env.production` / `.env.development`)
NodeMap verwendet Umgebungsvariablen zur Steuerung von API-Verhalten, Serverpfaden und Moduswahl
(Mock oder Produktion).
## 📂 Speicherort
- **Entwicklung**: `.env.development`
- **Produktion**: `.env.production` (für `npm run build` & `npm start`)
## 🔧 Wichtige Variablen
| Variable | Beispielwert | Beschreibung |
| --------------------------- | ------------------- | -------------------------------------------------------------------------------------------------------- |
| `DB_HOST` | `localhost` | Adresse des Datenbankservers (MySQL) |
| `DB_PORT` | `3306` | Port für die Datenbankverbindung |
| `DB_NAME` | `talas` | Datenbankname |
| `DB_USER` | `root` | Benutzername für MySQL |
| `DB_PASSWORD` | `geheim` | Passwort für MySQL |
| `NEXT_PUBLIC_API_PORT_MODE` | `prod` oder `dev` | Steuert API-Routing bei Services (z.B. Portwechsel für lokal) |
| `NEXT_PUBLIC_USE_MOCKS` | `true` oder `false` | Aktiviert den Mockdaten-Modus über `/api/mocks/...` |
| `basePath` (in config.json) | `/talas5` oder leer | Optionaler Pfad, falls App unter Subpfad läuft (z.B. IIS). Wird jetzt in `public/config.json` gepflegt. |
| `NEXT_PUBLIC_DEBUG` | `true` oder `false` | Aktiviert zusätzliche `console.log` Ausgaben für Debugging im Browser |
## 📦 Beispiel `.env.production`
```env
DB_HOST=localhost
DB_PORT=3306
DB_NAME=talas
DB_USER=root
DB_PASSWORD=geheim
NEXT_PUBLIC_API_PORT_MODE=prod
NEXT_PUBLIC_USE_MOCKS=false
// public/config.json
{
...
"basePath": "/talas5"
}
NEXT_PUBLIC_DEBUG=false
```
## 📦 Beispiel `.env.development`
```env
DB_HOST=localhost
DB_PORT=3306
DB_NAME=talas
DB_USER=root
DB_PASSWORD=geheim
NEXT_PUBLIC_API_PORT_MODE=dev
NEXT_PUBLIC_USE_MOCKS=true
// public/config.json
{
...
"basePath": "/talas5"
}
NEXT_PUBLIC_DEBUG=true
```
---
[Zurück zur Übersicht](../README.md)