gpt4 book ai didi

angular - 服务器端渲染在 iis 中的 Angular 通用中不起作用

转载 作者:太空狗 更新时间:2023-10-29 17:20:45 25 4
gpt4 key购买 nike

我提到了 https://github.com/angular/universal-starter并已在 angular5 中实现。服务器端渲染在 iis 中托管后无法正常工作。在 localhost:4000 中没问题

谢谢

最佳答案

ASP.NET 使用 JavaScriptServices。它提供:

Microsoft.AspNetCore.SpaTemplates plugs into dotnet new, providing project templates for Angular 2, Aurelia, Knockout, React, and React+Redux applications. Microsoft.AspNetCore.SpaServices is how SpaTemplates-produced projects work internally. It provides useful features for SPA applications, such as server-side rendering for Angular and React applications, plus integration with Webpack build middleware. Microsoft.AspNetCore.NodeServices is how SpaServices works internally. It’s a low-level library that gives a fast, robust way for ASP.NET Core applications to run arbitrary JavaScript code on the server.

TUTORIAL

#Server-side-prerendering

aspnetcore-angular2-universal. After running it,I got Child compilation failed error

@kamalav,我在本地测试过。

要求:确保你至少安装了 Node 6.x 或更高版本(带 npm 3+)!此存储库使用 ASP.Net Core 2.0,它对 .NET Core Runtime 2.0.0 和 .NET Core SDK 2.0.0 有硬性要求。请从这里安装这些项目

  1. npm 安装
  2. npm run build:dev
  3. 网络还原
  4. 网络运行

关于angular - 服务器端渲染在 iis 中的 Angular 通用中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49425314/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com