【发布时间】:2018-06-19 09:23:47
【问题描述】:
如何在 Apache WAMP/XAMPP 服务器上部署构建?
我有一个使用create-react-app 创建的应用程序,我在这个应用程序上有两个页面
当我执行 yarn start 或 npm start 时,它工作正常,所有页面都在 URL 导航或按钮单击时正确呈现
我执行了构建命令
npm 运行构建
它正在生成build 文件夹中的所有static 和index.html 文件。
我将此构建文件夹内容移动到 wamp 文件夹的 www 并在 URL http://localhost 上执行,它仅显示主页。下一页给出404 not found error
但是当我执行 npm 命令的 serve 模块时,它在 http://localhost:5000 上运行良好
服务构建
请帮我解决这个问题?
我必须在 wamp 服务器上部署我的应用程序,所有都是静态页面,没有其他 api 内容
【问题讨论】:
标签: apache reactjs react-router create-react-app yarnpkg