英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论