[英]How to deploy node + react App on goDaddy shared hosting
I am trying to deploy react and nodejs app on GoDaddy hosting but its just showing nodejs output,我正在尝试在 GoDaddy 托管上部署 react 和 nodejs 应用程序,但它只显示 nodejs 输出,
I am serving my build folder like this我正在为我的构建文件夹提供这样的服务
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'));
});
}
still react app isn't showing up仍然反应应用程序没有出现
i had the same problem with this.我有同样的问题。 i just removed the if condition and its started working fine because the if condition
process.env.NODE_ENV
doesnt work here..:)我刚刚删除了 if 条件并且它开始工作正常,因为 if 条件
process.env.NODE_ENV
在这里不起作用..:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.