服务器如何使用Next.js生成完整的文档以发送给客户端?

发布于 2025-02-12 13:26:14 字数 264 浏览 0 评论 0原文

Next.js是我最令人困惑的技术之一,我不了解它在服务器上的工作方式,服务器知道我们需要使用next.js创建的文件实现服务器端渲染。在构建时间?

我了解客户端部分,但是服务器如何在部署下一步创建的网站文件后需要实现服务器端渲染。

没有next.js创建的React项目的区别是什么,在该项目中,服务器以响应客户端请求发送空的HTML文档,以及使用Next.js创建的React项目,服务器将在其中将将完整的文档发送给客户?

Next.js is one of the most confusing technologies for me, i can't understand how it works on the server, how a server knows we need to achieve server side rendering with files created by Next.js in the build time?

I understand the client part, but how a server know that we need to achieve server side rendering after deploying the website files created by Next.

What is the difference between a React project created without Next.js in which the server send an empty HTML document in response to a client request, and a React project created with Next.js in which a server will send a full document to the client??

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

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

发布评论

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

评论(1

愁以何悠 2025-02-19 13:26:15

服务器如何知道我们需要通过构建时间中的Next.js创建的文件来实现服务器端?

您是否看过 next.js Server.js Server side Rendering文档?。有在此处进行更多关于静态生成的信息

还需要了解有关服务器端渲染的更多信息,查看此站点

在没有下一步的情况下创建的React项目之间有什么区别,在该项目中,服务器以响应客户端请求发送空的HTML文档,以及使用Next.js创建的React项目,服务器将发送完整文档向客户??

不完全确定此处的措辞,但是如果您要问下一步提供什么,则它将为您提供在他们的上列出的所有内容着陆页您必须编码或弄清楚。它们提供了一种快速的方法来总结并生成准备生产的文件以部署。

how a server knows we need to achieve server side rendering with files created by Next.js in the build time?

Have you taken a look at the Next.js server-side rendering documentation here?. There is more about static generation here.

Also for more on server-side rendering, check out this site

What is the difference between a React project created without Next.js in which the server send an empty HTML document in response to a client request, and a React project created with Next.js in which a server will send a full document to the client??

Not entirely sure with the wording here, but if you are asking what Next provides, it is a framework that will give you everything listed on their landing page that you would have to code up or figure out otherwise. They provide a quick way to wrap up and generate production-ready files to deploy.

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