Angular服务器端渲染问题

时间:2020-07-16 10:52:17

标签: angular server-side-rendering

我正在尝试出于SEO的目的进行服务器端渲染。因此,为了先做需要的事情,我使用以下命令添加了角度通用性:

ng add @nguniversal/express-engine

npm run build:ssr
npm run serve:ssr

这最初导致窗口未定义错误,该错误通过按照此article中的建议安装多米诺得到解决。

我在server.ts上增加了文章中建议的命令。

但是现在当我运行serve:ssr时,我得到以下信息:

Node Express server listening on http://localhost:4000
(node:12117) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

当我打开链接时,它永远不会打开或给出任何错误,只是一直试图加载。

如何解决此问题。

0 个答案:

没有答案