【发布时间】:2021-01-01 22:46:24
【问题描述】:
我正在尝试在 GoDaddy 主机上部署 react 和 nodejs 应用程序,但它只显示 nodejs 输出,
我正在像这样为我的构建文件夹提供服务
if (process.env.NODE_ENV === "production") {
app.use(express.static(path.join(__dirname, 'build')));
app.get("/*", (req, res) => {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
}
仍然没有显示反应应用程序
【问题讨论】:
标签: node.js reactjs hosting shared-hosting