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
This commit is contained in:
@@ -17,7 +17,7 @@ import { updatePolylineCoordinatesThunk } from "../../redux/thunks/database/poly
|
||||
import { openInNewTab } from "../../utils/openInNewTab";
|
||||
|
||||
//--------------------------------------------
|
||||
export const setupPolylines = (
|
||||
export const setupPolylines = async (
|
||||
map,
|
||||
linePositions,
|
||||
lineColors,
|
||||
@@ -29,7 +29,14 @@ export const setupPolylines = (
|
||||
polylineVisible
|
||||
) => {
|
||||
const mode = process.env.NEXT_PUBLIC_API_PORT_MODE;
|
||||
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || "";
|
||||
let basePath = "";
|
||||
try {
|
||||
const res = await fetch("/config.json");
|
||||
if (res.ok) {
|
||||
const config = await res.json();
|
||||
basePath = config.basePath || "";
|
||||
}
|
||||
} catch (e) {}
|
||||
if (!polylineVisible) {
|
||||
//console.warn("Polylines deaktiviert - keine Zeichnung");
|
||||
return { markers: [], polylines: [] };
|
||||
|
||||
Reference in New Issue
Block a user