async function getStates(url) { let states = await fetch(url); let stateJson = await states.text(); console.log(stateJson) } getStates('127.0.0.1:5000/servicestate')