2

I'm trying to invoke a HTTP endpoint in my deployed Heroku app with Heroku Scheduler, which basically runs commands on Heroku bash at a fixed rate.

When I run $ heroku run bash, I can read my port with echo $PORT (let's say 5555). However when I try to access my webpage using curl http://localhost:5555, it does not work.

What is the way to reach to the app within Heroku bash without using the app name?

4

2 回答 2

1

It's seems that there is no pre-configured environment variable.

However you can set it:

heroku config:add HEROKU_URL=http://<your app>.herokuapp.com
于 2012-11-10T02:34:49.367 回答
1

When you run "heroku run bash" you are actually firing up a one-off dyno which - according to Heroku - is a different process (from the dyno running your "web" process type) running on a different runtime instance. Routing does not exist between processes, so the HTTP requests you're issuing will always fail.

于 2014-01-13T16:44:44.347 回答