React app logs on Google App Engine says "Starting the development server…" and takes 30+ seconds to start

huangapple go评论58阅读模式
英文:

React app logs on Google App Engine says "Starting the development server..." and takes 30+ seconds to start

问题

我已将React应用部署到Google App Engine(使用F2实例,nodejs16运行时),启动速度非常慢,至少需要30秒。我还注意到日志中显示“Starting the development server...”,这似乎不好,因为显然是在生产环境中。

这两件事是否相关?无论如何,我应该做些什么,以确保启动生产服务器?在部署之前,我确实运行了npm run build,所以build文件夹已包含在部署中。

英文:

I have deployed a React app to Google App Engine (using an F2 instance, nodejs16 runtime) and the start up is incredibly slow, at least 30 seconds. I've also noticed in the logs that it says "Starting the development server...", which seems bad because it's obviously in production.

Are the two things related? And, either way, should I be doing something so that a production server is being started? Before deploying, I did run npm run build and so the build folder has been included in the deployment

答案1

得分: 1

最后,我意识到我只应该部署我的构建文件到Google App Engine,而不是整个代码库。

我还从GAE切换到了Netlify,因为它是免费的。

英文:

In the end, I realised that I should only have deployed my build files to Google App Engine and not the entire codebase.

I also switched to Netlify from GAE because it was free.

huangapple
  • 本文由 发表于 2023年1月7日 06:07:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/75036514.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定