text-display/src/public/getText.js
2022-02-23 11:31:46 +01:00

15 lines
479 B
JavaScript

import FetchService from './FetchService.js';
const fetchService = new FetchService();
function buildHeaders(authorization = null) {
const headers = {
"Content-Type": "application/json",
"Authorization": (authorization) ? authorization : "Bearer TOKEN_MISSING"
};
return headers;
}
const response = await fetchService.performGetHttpRequest(window.location.href + 'text', buildHeaders());
document.getElementById("text").innerHTML = response.text;