heroku - 将mern堆栈部署到Heroku时如何访问反应页面?
问题描述
我使用 react + node.js(typescript) 成功地将应用程序部署到 Heroku,这是问题,现在我可以在后端访问 api,例如 my-app.com/api/post ,但我不知道如何访问反应页面。以下是我的构建日志
build
276> tsc && cd client && npm run build
277
278
279> super_sideproject@0.1.0 build
280> react-scripts build
281
282(node:5266) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /home/travis/build/hardco2020/React_Node_Facebook/client/node_modules/postcss-safe-parser/node_modules/postcss/package.json.
283Update this package.json to use a subpath pattern like "./*".
284(Use `node --trace-deprecation ...` to show where the warning was created)
285Creating an optimized production build...
286Compiled with warnings.
287
313
314Search for the keywords to learn more about each warning.
315To ignore, add // eslint-disable-next-line to the line before.
316
317File sizes after gzip:
318
319 78.1 KB build/static/js/2.4fc22d01.chunk.js
320 5.11 KB build/static/js/main.ecb6537a.chunk.js
321 1.65 KB build/static/css/main.d7a5a54e.chunk.css
322 785 B build/static/js/runtime-main.4f17638d.js
323
324The project was built assuming it is hosted at ./facebook/.
325You can control this with the homepage field in your package.json.
326
327The build folder is ready to be deployed.
328
329Find out more about deployment here:
这是我的文件夹
.
├── .travis.yml
├── client
│ ├── package.json
│ └── index.js
├── package.json
│
├── tsconfig.json
所以经过一些研究,我认为关键是管理主页,所以我在客户端的 package.json 中添加了主页 facebook ,我认为它会像 my-app.com/facebook 一样工作,但它不会工作,我是这个部署的新手,所以有人知道如何访问 Heroku 上的前端页面吗?
解决方案
推荐阅读
- openssh - OpenSSH(7.7&8.1) windows 2019标准版问题
- liferay - Liferay 7.3 LoginPortlet 上不需要的 CSRF 验证
- node.js - Dockerized Node JS 应用程序无法从主机访问
- .net - dotnet pack - 错误 MSB3644: .NETFramework,Version=v3.5 的参考程序集未找到
- javascript - 使用 Jquery 在每次滚动移动(100vh)时执行的平滑滚动移动
- azure - 天蓝色更新后应用程序不会自动重启
- asp.net - 如何在按钮单击时附加到 DataGrid 而无需在 VB 中重新加载页面
- powershell - 使用 Windows pod 附加 FSx 共享
- javascript - 如何为移动设备创建切换导航菜单?
- reactjs - 反应表格单元格