我有一个 Angular 应用程序,我正在尝试使用 Angular 通用(https://angular.io/guide/universal)进行服务器端渲染,但它似乎不起作用。我捆绑了我的应用程序并通过 express 运行它,我点击了http://localhost:4000并且它一直加载直到我从浏览器看到 ERR_EMPTY_RESPONSE
我已经尝试了几乎所有的东西,但没有运气!任何帮助将非常感激
这是我的代码的详细信息
包.json
{
"name": "my-app",
"version": "3.0.0",
"author": "N/A",
"description": "N/A",
"scripts": {
"ng": "ng",
"start": "ng serve --port 8000 --host 0.0.0.0",
"build": "ng build",
"build:ssr": "npm run build:client-and-server-bundles && npm run webpack:server",
"serve:ssr": "node dist/server.js",
"build:client-and-server-bundles": "ng build --prod && ng run my-app:server",
"webpack:server": "webpack --config webpack.server.config.js --progress --colors",
"test": "ng test",
"lint": "tslint ./src/**/*.ts -t verbose",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@agm/core": …Run Code Online (Sandbox Code Playgroud)