feat: npm install nextjs-cors weil

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.
This commit is contained in:
ISA
2024-07-16 14:30:17 +02:00
parent f59fa74e12
commit de40d9ccb9
7 changed files with 65 additions and 6 deletions

View File

@@ -4,7 +4,8 @@
const mapVersion = "0.5.3"; // Die Version der verwendeten Karte
const standardSideMenu = true; // Einstellung, ob ein standardmäßiges Seitenmenü verwendet wird
const fullSideMenu = false; // Einstellung, ob ein vollständiges Seitenmenü verwendet wird
const serverURL = "/api"; // Die Basis-URL des Servers, von dem Daten bezogen werden
//const serverURL = "/api"; // Die Basis-URL des Servers, von dem Daten bezogen werden
const serverURL = "http://10.10.0.70";
console.log("serverURL in config:", serverURL);
// Initialisieren von Variablen, die später im Browserkontext gesetzt werden
let windowHeight, url_string, url, idMap, idUser;
@@ -41,6 +42,9 @@ if (typeof window !== "undefined") {
mapDataIconUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GetIconsStatic`;
//webserviceGisLinesStatusUrl = `http://10.10.0.13/talas5/ClientData/WebServiceMap.asmx/GisLinesStatus?idMap=${idMap}`;
//webserviceGisLinesStatusUrl = `http://localhost:3000/api/linesColorApi`;
//webserviceGisLinesStatusUrl = `http://localhost:3000/api/linesColorApi`;
//webserviceGisLinesStatusUrl = `${"serverURL"}:3000/api/linesColorApi`;
webserviceGisLinesStatusUrl = `http://localhost:3000/api/linesColorApi`;
//webserviceGisLinesStatusUrl = `http://192.168.10.14/talas5/ClientData/WebServiceMap.asmx/GisLinesStatus?idMap=${idMap}`;
@@ -78,3 +82,9 @@ export {
mapDataIconUrl,
webserviceGisLinesStatusUrl,
};
/*
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.
*/

View File

@@ -28,3 +28,9 @@ export const MAP_DATA_ICON_URL = `${SERVER_URL}/talas5/ClientData/WebserviceMap.
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.
*/