reactjs - Heroku 说构建成功,但前端没有出现
问题描述
Heroku 说我的应用程序已经构建成功,但是当我进入部署的网站时,我只能看到:
我已按照 Heroku 上的详细说明进行操作,这就是我在 app.js 文件中的内容(与我已经部署好的另一个应用程序的格式完全相同):
app.use(express.static(path.join(__dirname, "client/build")));
app.get("/", function (req, res, next) {
res.send("Access the API at path /api");
});
app.use("/bubbles", bubblesRouter);
// Anything that doesn't match the above, send back index.html
app.get("*", (req, res) => {
res.sendFile(path.join(__dirname + "/client/build/index.html"));
});
有谁知道为什么我打开应用程序时看不到前端?
解决方案
推荐阅读
- f# - 从有区别的联合访问元组项
- python - 如何使用 Python 在 Openstreetmap 中检索特定的道路类型(主要、次要、三次等)?
- twitter-bootstrap - 如何在使用 Nightwatch 的 e2e 测试中选择引导复选框?
- hazelcast - Hazelcast:节点 IP 自动添加到黑名单
- spring-boot - OptaPlanner 在 Spring 启动时出现 java 反射错误
- javascript - ReactJS:渲染动态组件并传递道具
- python - 如何在一个列表中而不是在另一个列表中查找字典
- node.js - Passport.js:使用 JWT 策略和现有的 Slack 策略进行客户端身份验证
- json - laravel guzzle 读取数据库而不是 json
- c# - C# Entity Framework .Any() 无法创建“匿名类型”类型的常量值