Configured tools for new libxml backend address

This commit is contained in:
2023-05-22 12:16:17 +02:00
parent 5887c92a2a
commit 8bf707abd2
3 changed files with 9 additions and 9 deletions

View File

@@ -9,11 +9,11 @@ import Parser
app = Flask(__name__) app = Flask(__name__)
CORS(app) CORS(app)
cors = CORS(app, resource={ # cors = CORS(app, resource={
r"/*":{ # r"/*":{
"origins":"*" # "origins":"*"
} # }
}) # })
def process_xml(request: request, type: str) -> str: def process_xml(request: request, type: str) -> str:
"""Function to process """Function to process

View File

@@ -333,7 +333,7 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) {
const sourceElement = document.getElementById(sourceId); const sourceElement = document.getElementById(sourceId);
const targetElement = document.getElementById(targetId); const targetElement = document.getElementById(targetId);
const infoElement = document.getElementById("formatinfo"); const infoElement = document.getElementById("formatinfo");
const port = 8082; const backend = "libxml";
var xmlData = sourceElement.innerText.trim(); var xmlData = sourceElement.innerText.trim();
var empty = false; var empty = false;
@@ -344,7 +344,7 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) {
} }
if (!empty) { if (!empty) {
restRequest(port, endpoint, xmlData, "").then(function (result) { restRequest(backend, endpoint, xmlData, "").then(function (result) {
if (result.status == "OK") { if (result.status == "OK") {
targetElement.innerText = result.result.trim(); targetElement.innerText = result.result.trim();
highlightSyntax(targetElement.id); highlightSyntax(targetElement.id);
@@ -374,7 +374,7 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) {
* @function * @function
* @name restRequest * @name restRequest
* @kind function * @kind function
* @param {any} port of target service * @param {any} backend target backend
* @param {any} endpoint of target service * @param {any} endpoint of target service
* @param {any} xmlData XML that will be sent * @param {any} xmlData XML that will be sent
* @param {any} transformData data used to transform given XML * @param {any} transformData data used to transform given XML

View File

@@ -21,7 +21,7 @@ server {
} }
location /libxml/ { location /libxml/ {
proxy_pass http://xmltools-libxml-backend:8082/; proxy_pass http://xmltools-libxml-backend/;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;