ruby-on-rails - Heroku Rails 服务器 API 启动时未设置正确的端口号
问题描述
我有一个 Rails API 后端和一个部署到 Heroku 的 React 前端。当我尝试加载调用 API 的页面时,它会挂起,然后最终在控制台中出现此错误:
GET https://MYAPP.herokuapp.com:3001/auth/refresh_token net::ERR_TIMED_OUT
当我在应用程序启动时查看日志时,看起来好像我正在设置3001
我想要的端口,但看起来那些 puma 正在侦听不同的端口号:
2020-10-01T04:28:51.720203+00:00 heroku[web.1]: Starting process with command `bundle exec puma -t 5:5 -p ${PORT:-3001} -e ${RACK_ENV:-production}`
2020-10-01T04:28:55.321298+00:00 app[web.1]: Puma starting in single mode...
2020-10-01T04:28:55.321325+00:00 app[web.1]: * Version 4.3.5 (ruby 2.6.6-p146), codename: Mysterious Traveller
2020-10-01T04:28:55.321326+00:00 app[web.1]: * Min threads: 5, max threads: 5
2020-10-01T04:28:55.321326+00:00 app[web.1]: * Environment: production
2020-10-01T04:29:04.625683+00:00 app[web.1]: * Listening on tcp://0.0.0.0:55912
我是否应该将我的提取配置为使用此 URL?:https://MYAPP.herokuapp.com/auth/refresh_token
基本上,我要问的是:基于此日志信息,如果我的 React 应用程序正在侦听,我的 Rails API 在哪里侦听:https://MYAPP.herokuapp.com
?
解决方案
推荐阅读
- javascript - 我们如何找到任何 iframe 中的页面的样式表?
- python - 将文件从一个文件夹复制到另一个文件夹并重命名文件
- hibernate - 如何使用 JPA 持久化字符串数组
- python - 用于一对多网络的 ConvLSTM2D
- solr - 在 Hue 中创建可点击的 URL
- angular - 如何用角度刷新数据?
- java - 如何从 C++ 服务器到 Java 客户端的 TCP 视频流?
- python - 一次处理多个绘图对象
- wordpress - ERR_INCOMPLETE_CHUNKED_ENCODING 200 - WordPress
- testing - 如何为 xunit 测试设置测试运行标题?