问题描述
我成功地使用 react + node.js(typescript) 将应用程序部署到 Heroku,这是问题,现在我可以像 my-app.com/api/post 一样在后端访问 api,但我不知道如何访问反应页面。以下是我的构建日志
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
所以经过一些研究,我认为关键是管理主页,所以我用 facebook 在客户端的 package.json 中添加主页,我认为它会像 my-app.com/facebook 一样工作,但它不起作用,我是这个部署方面的新手,所以有人知道如何访问 Heroku 上的前端页面吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)