function queryLegacyAPI(query) {
return fetch(api.getData(query))
.then(response => response.text())
.then(xmlString => parseXML(xmlString))
.then(xml => { return xml; })
);
}
function formatResponse(data) {
const template = await loadTemplate();
const html = json2html.transform(data, t);
return html;
}
function transform2Json(data) {
const xslt = await loadXslt();
const parser = new DOMParser();
const doc = parser.parseFromString(data, "application/xml");
const json = doc.transformNode(xslt)
return json;
}
function queryLegacyAndFormat() {
return compose(
formatResponse,
transform2Json,
queryLegacyAPI
)(query);
}
🤔
Translation
Query
Static Assets
Translation
Query
Static Assets
Translation
Query
Static Assets
FaaS
Translation
Query
Static Assets
FaaS
đź’°
Check out her great talk on Serverless called