parc
parc

Reputation: 11

How to get Url Port for Rails instance without request/response loop?

Is there a way to get the url/port that the current rails app is running on without using the http request/response loop?

Or a way to invoke a request to self from within a rails app that will spawn the correct request object to get the url/port?

Upvotes: 1

Views: 360

Answers (1)

Chris G.
Chris G.

Reputation: 3981

env["SERVER_PORT"]

Would using this environment variable work?

Upvotes: 1

Related Questions