diff --git a/Backend-libXML/main.py b/Backend-libXML/main.py index 4445cab..e4fefe5 100644 --- a/Backend-libXML/main.py +++ b/Backend-libXML/main.py @@ -9,11 +9,11 @@ import Parser app = Flask(__name__) CORS(app) -cors = CORS(app, resource={ - r"/*":{ - "origins":"*" - } -}) +# cors = CORS(app, resource={ +# r"/*":{ +# "origins":"*" +# } +# }) def process_xml(request: request, type: str) -> str: """Function to process diff --git a/Frontend/assets/scripts/tools/scripts.js b/Frontend/assets/scripts/tools/scripts.js index 07c8684..729ee8e 100644 --- a/Frontend/assets/scripts/tools/scripts.js +++ b/Frontend/assets/scripts/tools/scripts.js @@ -333,7 +333,7 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) { const sourceElement = document.getElementById(sourceId); const targetElement = document.getElementById(targetId); const infoElement = document.getElementById("formatinfo"); - const port = 8082; + const backend = "libxml"; var xmlData = sourceElement.innerText.trim(); var empty = false; @@ -344,7 +344,7 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) { } if (!empty) { - restRequest(port, endpoint, xmlData, "").then(function (result) { + restRequest(backend, endpoint, xmlData, "").then(function (result) { if (result.status == "OK") { targetElement.innerText = result.result.trim(); highlightSyntax(targetElement.id); @@ -374,7 +374,7 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) { * @function * @name restRequest * @kind function -* @param {any} port of target service +* @param {any} backend target backend * @param {any} endpoint of target service * @param {any} xmlData XML that will be sent * @param {any} transformData data used to transform given XML diff --git a/Frontend/nginx.conf b/Frontend/nginx.conf index 8ce7f3a..0639769 100644 --- a/Frontend/nginx.conf +++ b/Frontend/nginx.conf @@ -21,7 +21,7 @@ server { } location /libxml/ { - proxy_pass http://xmltools-libxml-backend:8082/; + proxy_pass http://xmltools-libxml-backend/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;