refactor: .env.local und /config/urls.js aufgeräumt
This commit is contained in:
38
.env.local
38
.env.local
@@ -7,42 +7,8 @@ DB_PASSWORD="root#$"
|
|||||||
DB_NAME=talas_v5
|
DB_NAME=talas_v5
|
||||||
DB_PORT=3306
|
DB_PORT=3306
|
||||||
######################### Online Karte
|
######################### Online Karte
|
||||||
NEXT_PUBLIC_ONLINE_TILE_LAYER="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
#NEXT_PUBLIC_ONLINE_TILE_LAYER="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
||||||
######################### Offline Karte
|
######################### Offline Karte
|
||||||
#NEXT_PUBLIC_ONLINE_TILE_LAYER="http://127.0.0.1:3000/mapTiles/{z}/{x}/{y}.png"
|
#NEXT_PUBLIC_ONLINE_TILE_LAYER="http://127.0.0.1:3000/mapTiles/{z}/{x}/{y}.png"
|
||||||
|
NEXT_PUBLIC_ONLINE_TILE_LAYER="http://10.10.0.13:3000/mapTiles/{z}/{x}/{y}.png"
|
||||||
#DB_HOST=10.10.0.13
|
|
||||||
#DB_USER=root
|
|
||||||
#DB_PASSWORD="root#$"
|
|
||||||
#DB_NAME=talas_v5
|
|
||||||
#DB_PORT=3306
|
|
||||||
#########################
|
|
||||||
|
|
||||||
#NEXT_PUBLIC_BASE_URL="http://10.10.0.13/talas5/devices/"
|
|
||||||
#NEXT_PUBLIC_SERVER_URL="http://10.10.0.13"
|
|
||||||
#NEXT_PUBLIC_PROXY_TARGET="http://10.10.0.13"
|
|
||||||
#NEXT_PUBLIC_ONLINE_TILE_LAYER="http://10.10.0.13:3000/mapTiles/{z}/{x}/{y}.png"
|
|
||||||
#########################
|
|
||||||
|
|
||||||
|
|
||||||
#########################
|
|
||||||
#device nur Verlinkung wenn die gleiche DB ist
|
|
||||||
#NEXT_PUBLIC_BASE_URL="http://10.10.0.70/talas5/devices/"
|
|
||||||
#NEXT_PUBLIC_SERVER_URL="http://10.10.0.70"
|
|
||||||
#NEXT_PUBLIC_PROXY_TARGET="http://10.10.0.70"
|
|
||||||
#NEXT_PUBLIC_ONLINE_TILE_LAYER="http://10.10.0.13:3000/mapTiles/{z}/{x}/{y}.png"
|
|
||||||
#NEXT_PUBLIC_ONLINE_TILE_LAYER="http://127.0.0.1:3000/mapTiles/{z}/{x}/{y}.png"
|
|
||||||
#########################
|
|
||||||
|
|
||||||
#DB_HOST=192.168.10.168
|
|
||||||
#DB_USER=root
|
|
||||||
#DB_PASSWORD="root#$"
|
|
||||||
#DB_NAME=talas_v5
|
|
||||||
#DB_PORT=3306
|
|
||||||
#########################
|
|
||||||
#URLs für den Client (clientseitig)
|
|
||||||
#NEXT_PUBLIC_BASE_URL="http://192.168.10.168/talas5/devices/"
|
|
||||||
#NEXT_PUBLIC_SERVER_URL="http://192.168.10.168"
|
|
||||||
#NEXT_PUBLIC_PROXY_TARGET="http://192.168.10.168"
|
|
||||||
#NEXT_PUBLIC_ONLINE_TILE_LAYER="http://192.168.10.14:3000/mapTiles/{z}/{x}/{y}.png"
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,64 +11,14 @@ if (typeof window !== "undefined") {
|
|||||||
BASE_URL = `${originWithoutPort}/api`; // Dynamische Basis-URL
|
BASE_URL = `${originWithoutPort}/api`; // Dynamische Basis-URL
|
||||||
SERVER_URL = originWithoutPort; // Dynamisch ermittelt, ohne Port
|
SERVER_URL = originWithoutPort; // Dynamisch ermittelt, ohne Port
|
||||||
PROXY_TARGET = `${originWithoutPort}:3000`; // Dynamisch für einen Proxy
|
PROXY_TARGET = `${originWithoutPort}:3000`; // Dynamisch für einen Proxy
|
||||||
ONLINE_TILE_LAYER = `https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`;
|
//ONLINE_TILE_LAYER = `https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`;
|
||||||
OFFLINE_TILE_LAYER = `${originWithoutPort}:3000/mapTiles/{z}/{x}/{y}.png`;
|
//OFFLINE_TILE_LAYER = `https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`;
|
||||||
MAP_TILES_LAYER = ONLINE_TILE_LAYER; // Standardwert
|
ONLINE_TILE_LAYER = "http://10.10.0.13:3000/mapTiles/{z}/{x}/{y}.png"; //Map von Talas_v5 Server
|
||||||
} else {
|
OFFLINE_TILE_LAYER = "http://10.10.0.13:3000/mapTiles/{z}/{x}/{y}.png"; //Map von Talas_v5 Server
|
||||||
// Server-seitige Logik (Fallback)
|
//ONLINE_TILE_LAYER = `${originWithoutPort}:3000/mapTiles/{z}/{x}/{y}.png`;
|
||||||
const originWithoutPort = "http://fallback-url.com"; // Ersetze dies durch die gewünschte Fallback-URL
|
//OFFLINE_TILE_LAYER = `${originWithoutPort}:3000/mapTiles/{z}/{x}/{y}.png`;
|
||||||
|
|
||||||
BASE_URL = `${originWithoutPort}/api`;
|
|
||||||
SERVER_URL = originWithoutPort;
|
|
||||||
PROXY_TARGET = `${originWithoutPort}:3000`;
|
|
||||||
ONLINE_TILE_LAYER = `https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`;
|
|
||||||
OFFLINE_TILE_LAYER = `${originWithoutPort}:3000/mapTiles/{z}/{x}/{y}.png`;
|
|
||||||
MAP_TILES_LAYER = ONLINE_TILE_LAYER; // Standardwert
|
MAP_TILES_LAYER = ONLINE_TILE_LAYER; // Standardwert
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export der dynamischen Werte
|
// Export der dynamischen Werte
|
||||||
export { BASE_URL, SERVER_URL, PROXY_TARGET, ONLINE_TILE_LAYER, OFFLINE_TILE_LAYER, MAP_TILES_LAYER };
|
export { BASE_URL, SERVER_URL, PROXY_TARGET, ONLINE_TILE_LAYER, OFFLINE_TILE_LAYER, MAP_TILES_LAYER };
|
||||||
|
|
||||||
/* export const BASE_URL = process.env.NEXT_PUBLIC_BASE_URL; //Station in Tab öffnen
|
|
||||||
export const SERVER_URL = process.env.NEXT_PUBLIC_SERVER_URL; //Die Konstante ist in MapComponent.js und useLineData.js verwendet
|
|
||||||
export const PROXY_TARGET = process.env.NEXT_PUBLIC_PROXY_TARGET; // damit nodejs auf Port 3000 auf dem Server Talas5 auf Port 80 aufgerufen kann, ansonsten gibt CORS Fehler
|
|
||||||
export const ONLINE_TILE_LAYER = process.env.NEXT_PUBLIC_ONLINE_TILE_LAYER; //Map von Talas_v5 Server */
|
|
||||||
//-----------------------------------
|
|
||||||
//export const ONLINE_TILE_LAYER = "http://10.10.0.13:3000/mapTiles/{z}/{x}/{y}.png"; //Map von Talas_v5 Server
|
|
||||||
// export const PROXY_TARGET = "http://10.10.0.70"; // damit nodejs auf Port 3000 auf dem Server Talas5 auf Port 80 aufgerufen kann, ansonsten gibt CORS Fehler
|
|
||||||
// export const SERVER_URL = "http://10.10.0.70"; //Die Konstante ist in MapComponent.js und useLineData.js verwendet
|
|
||||||
// export const BASE_URL = "http://10.10.0.70/talas5/devices/"; //Station in Tab öffnen
|
|
||||||
// //-----------------------------------
|
|
||||||
/* export const ONLINE_TILE_LAYER = "http://192.168.10.14:3000/mapTiles/{z}/{x}/{y}.png"; //Map von Talas_v5 Server
|
|
||||||
export const PROXY_TARGET = "http://192.168.10.167"; // damit nodejs auf Port 3000 auf dem Server Talas5 auf Port 80 aufgerufen kann, ansonsten gibt CORS Fehler
|
|
||||||
export const SERVER_URL = "http://192.168.10.167"; //Die Konstante ist in MapComponent.js und useLineData.js verwendet
|
|
||||||
export const BASE_URL = "http://192.168.10.167/talas5/devices/"; //Station in Tab öffnen */
|
|
||||||
//-----------------------------------
|
|
||||||
// export const ONLINE_TILE_LAYER = "http://192.168.10.14:3000/mapTiles/{z}/{x}/{y}.png"; //Map von Talas_v5 Server */
|
|
||||||
// export const PROXY_TARGET = "http://localhost"; // damit nodejs auf Port 3000 auf dem Server Talas5 auf Port 80 aufgerufen kann, ansonsten gibt CORS Fehler
|
|
||||||
// export const SERVER_URL = "http://localhost"; //in MapComponent.js wird es verwendet
|
|
||||||
// export const BASE_URL = "http://localhost/talas5/devices/"; //Station in Tab öffnen
|
|
||||||
//-----------------------------------
|
|
||||||
//-----------------------------------
|
|
||||||
// weil ich keine API habe, ansonsten serverURL ist localhost(IP-Adresse) für GisSystemStatic für die Benutzerrechte
|
|
||||||
//const serverURL = `${protocol}//${hostname}`;
|
|
||||||
//const serverURL = `${protocol}//${hostname}${port ? `:${port}` : ""}`;
|
|
||||||
//const serverURL = "http://localhost:3000";
|
|
||||||
//export const SERVER_URL = "http://10.10.0.13";
|
|
||||||
//export const SERVER_URL = "http://10.10.0.70";
|
|
||||||
|
|
||||||
// Online Daten URLs
|
|
||||||
/* export const MAP_GIS_STATIONS_STATIC_DISTRICT_URL = `${SERVER_URL}/talas5/ClientData/WebserviceMap.asmx/GisStationsStaticDistrict?idMap=${c}&idUser=${user}`; //idMap: 10, idUser: 484
|
|
||||||
export const MAP_GIS_STATIONS_STATUS_DISTRICT_URL = `${SERVER_URL}/talas5/ClientData/WebserviceMap.asmx/GisStationsStatusDistrict?idMap=${c}&idUser=${user}`;
|
|
||||||
export const MAP_GIS_STATIONS_MEASUREMENTS_URL = `${SERVER_URL}/talas5/ClientData/WebserviceMap.asmx/GisStationsMeasurements?idMap=${c}`;
|
|
||||||
export const MAP_GIS_SYSTEM_STATIC_URL = `${SERVER_URL}/talas5/ClientData/WebserviceMap.asmx/GisSystemStatic?idMap=${c}&idUser=${user}`;
|
|
||||||
export const MAP_DATA_ICON_URL = `${SERVER_URL}/talas5/ClientData/WebserviceMap.asmx/GetIconsStatic`;
|
|
||||||
export const WEBSERVICE_GIS_LINES_STATUS_URL =
|
|
||||||
"http://localhost:3000/api/linesColorApi";
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
Access to fetch at 'http://localhost:3000/api/linesColorApi' from origin 'http://10.10.0.13:3000' has been blocked by CORS policy:
|
|
||||||
No 'Access-Control-Allow-Origin' header is present on the requested resource.
|
|
||||||
If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
|
|
||||||
*/
|
|
||||||
|
|||||||
Reference in New Issue
Block a user