This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sendApiCall = document.getElementById('sendApiCall'); | |
const output = document.getElementById('output'); | |
const URL = (location.host === 'localhost:1234') ? '//localhost:3000/apitest' : 'https://righteous-quiet-sphynx.glitch.me/apitest'; | |
const EURL = (location.host === 'localhost:1234') ? '//localhost:3000/esource' : 'https://righteous-quiet-sphynx.glitch.me/esource'; | |
sendApiCall.addEventListener('click', () => { | |
// send api call | |
addLogs('Requesting server to process large data'); | |
document.body.style.cursor = 'wait'; | |
fetch(URL).then((res) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const city = document.getElementById('city'); | |
const label = document.getElementById('selected_city'); | |
const form = document.getElementById('realTimeForm'); | |
const secondsToUpdate = document.getElementById('seconds'); | |
const close = document.getElementById('close'); | |
const time = document.getElementById('time'); | |
const URL = (location.host === 'localhost:1234') ? '//localhost:3000/event-stream' : 'https://righteous-quiet-sphynx.glitch.me/event-stream'; | |
let selectedCityName = 'Asia/Calcutta'; | |
let selectedCityValue = 'Asia/Calcutta'; |