Go to heroku dashboard, go to "Setting" -> "Config Variables".
- Add "Config Vars"
- Name -> "PORT"
- Value use
80
.
const addScript = (src) => {
var elem = document.createElement("script");
elem.src = src;
document.head.appendChild(elem);
}
const getData = (data) => {
conosle.log(data)
}
addScript("https://APP_ADDRESS.herokuapp.com/data?url=http://habr.ru&callback=getData")