如何以重现Live网站404错误的方式运行Gatsby网站?

发布于 2025-01-22 15:02:08 字数 132 浏览 3 评论 0 原文

我有一个盖茨比网站,该网站在Live运行时会在Chrome Devtools中丢下404个错误。当我使用 npm运行开发本地运行时,我看不到错误。有没有办法以模仿实时网站的方式在本地运行该站点,以便我更有可能看到404错误?

I have a Gatsby site that throws a 404 error in Chrome devtools when run live. When I run it locally with npm run develop, I don't see the error. Is there a way to run the site locally in a way that mimics the live site so that I'm more likely to see the 404 error?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

晌融 2025-01-29 15:02:08

刚运行:

gatsby build

总结

gatsby serve

gatsby build 将编译您的应用程序并准备好部署,而 gatsby serve 将为您的网站生产构建用于测试,默认情况下是在端口上 9000

有关 gatsby-cli 命令的更多详细信息:

Just run:

gatsby build

And

gatsby serve

Summarizing, gatsby build will compile your application and make it ready for deployment while gatsby serve will serve the production build of your site for testing, by default at port 9000.

More details about gatsby-cli commands at: https://www.gatsbyjs.com/docs/reference/gatsby-cli/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文