Every service meant to be public work now on port 80 (#205)
Co-authored-by: Adam Bem <adam.bem@zoho.eu> Reviewed-on: #205 Reviewed-by: Mikolaj Widla <widlam@noreply.example.com>
This commit is contained in:
@@ -76,7 +76,7 @@ function clearDataField() {
|
||||
*/
|
||||
function fillDefaultXML(element) {
|
||||
if (element.classList.contains("active")) {
|
||||
const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086";
|
||||
const serverAddress = window.location.protocol + "//" + window.location.hostname;
|
||||
clearDefaultContent(document.getElementById("xmlArea"), "Insert XML here");
|
||||
fetch(serverAddress + "/assets/samples/sampleXml.xml")
|
||||
.then(response => response.text())
|
||||
@@ -100,7 +100,7 @@ function fillDefaultXML(element) {
|
||||
* @returns {void}
|
||||
*/
|
||||
function fillDefaultXSD(){
|
||||
const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086";
|
||||
const serverAddress = window.location.protocol + "//" + window.location.hostname;
|
||||
fetch(serverAddress + "/assets/samples/sampleXSD.xsd")
|
||||
.then( response => response.text() )
|
||||
.then( (XSDSchema) => {
|
||||
@@ -126,7 +126,7 @@ function fillDefaultXSD(){
|
||||
* @returns {void}
|
||||
*/
|
||||
function fillDefaultXSLT() {
|
||||
const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086";
|
||||
const serverAddress = window.location.protocol + "//" + window.location.hostname;
|
||||
fetch(serverAddress + "/assets/samples/XSLTTemplate.xslt")
|
||||
.then( response => response.text() )
|
||||
.then( (XSTLTemplate) => {
|
||||
@@ -277,9 +277,9 @@ function performRequest(endpoint, checkXML, checkTransform) {
|
||||
var xmlData = document.getElementById(sourceId).innerText.trim();
|
||||
var transformData = document.getElementById(transformId).innerText.trim();
|
||||
|
||||
var port = 8081;
|
||||
var backend = "java";
|
||||
if (getProcessor() == "libxml") {
|
||||
port = 8082;
|
||||
backend = "libxml";
|
||||
}
|
||||
|
||||
var empty = false;
|
||||
@@ -293,7 +293,7 @@ function performRequest(endpoint, checkXML, checkTransform) {
|
||||
empty = true;
|
||||
}
|
||||
if (!empty) {
|
||||
restRequest(port, endpoint, xmlData, transformData).then(function (result) {
|
||||
restRequest(backend, endpoint, xmlData, transformData).then(function (result) {
|
||||
document.getElementById("resultArea").innerText = result.result;
|
||||
highlightSyntax("resultArea");
|
||||
document.getElementById("procinfo").innerText = ' Computed using ' + result.processor;
|
||||
@@ -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,16 +374,15 @@ 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
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
async function restRequest(port, endpoint, xmlData, transformData) {
|
||||
const escapeChar = "specialEscapeChar";
|
||||
async function restRequest(backend, endpoint, xmlData, transformData) {
|
||||
|
||||
const addr = window.location.protocol + "//" + window.location.hostname + ":" + port + "/" + endpoint;
|
||||
const addr = window.location.protocol + "//" + window.location.hostname + "/" + backend + "/" + endpoint;
|
||||
|
||||
if (defaultStrings.includes(xmlData)) {
|
||||
xmlData = "<empty/>";
|
||||
|
||||
Reference in New Issue
Block a user