method
server_port
v5.2.3 -
Show latest stable
- Class:
ActionDispatch::Http::URL
server_port()public
Returns the requested port, such as 8080, based on SERVER_PORT
req = ActionDispatch::Request.new 'SERVER_PORT' => '80' req.server_port # => 80 req = ActionDispatch::Request.new 'SERVER_PORT' => '8080' req.server_port # => 8080