In some QA/Staging environments, generated URLs in the API include an incorrect port (:3000). This is caused by the fact that the Rails server is running in a container, bound to port 3000, and the request.port is different from the normal 80/443 defaults, thus Rails automatically specifies it as part of the URL. To get around this, always pass in a custom :port to the URL helper method that is called as part of storefront_api_url_for. In non-development environments, this port will always be nil, but for development :3000 will still be used for those who use a local Rails server for development at localhost:3000.
In some QA/Staging environments, generated URLs in the API include an incorrect port (
:3000
). This is caused by the fact that the Rails server is running in a container, bound to port 3000, and therequest.port
is different from the normal 80/443 defaults, thus Rails automatically specifies it as part of the URL. To get around this, always pass in a custom:port
to the URL helper method that is called as part ofstorefront_api_url_for
. In non-development environments, this port will always benil
, but for development:3000
will still be used for those who use a local Rails server for development atlocalhost:3000
.