Skip to content

Commit

Permalink
add ngrok flag
Browse files Browse the repository at this point in the history
  • Loading branch information
keyserfaty committed Sep 28, 2023
1 parent dbe748e commit 195e87e
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,18 +515,16 @@
countries
}

const URL = 'https://3562-24-232-110-208.ngrok-free.app/'

const xhr = new XMLHttpRequest()
xhr.open('POST', URL, true)
xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8')

xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200)
console.log(JSON.parse(xhr.responseText))
}

xhr.send(JSON.stringify(data))
return fetch('https://3562-24-232-110-208.ngrok-free.app/', { // todo: replace
method: 'POST',
headers: {
'Content-Type': 'application/json',
'ngrok-skip-browser-warning': true
},
body: JSON.stringify(data)
}).then(response => response.json())
.then(data => console.info(data))
.catch(error => console.error(error))
}

return {
Expand Down

0 comments on commit 195e87e

Please sign in to comment.