location /api/ {
proxy_pass http://localhost:8080;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
var textArray = [{
"text": "foo",
"delay" : "2000"
},
{
"text": "bar",
"delay" : "2000"
}];
(function one(i) {
console.log(textArray[i].text);
setTimeout(function() {
one(i+1);
}, textArray[i].delay)
})(0);