8wDlpd.png
8wDFp9.png
8wDEOx.png
8wDMfH.png
8wDKte.png

将 Angular 18 SSR 部署到 IIS

chaos 2月前

22 0

我正在尝试将 angular ssr 18 应用程序部署到我的本地 IIS。.NET Core 模板 + angular。当我从 Visual Studio 发布并将文件夹复制到 IIS 时,我的 API 可以工作,但 Angular 无法加载并且我得到...

我正在尝试将 angular ssr 18 应用程序部署到我的本地 IIS。.NET Core 模板 + angular。

当我从 Visual Studio 发布并将文件夹复制到 IIS 时,我的 API 可以工作,但 Angular 无法加载并且出现 404 错误。

我下载了 这个模板 并尝试发布它,但出现了同样的错误

这是我的 angular.json

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "test.web.application.client": {
      "projectType": "application",
      "schematics": {
        "@schematics/angular:component": {
          "standalone": false
        },
        "@schematics/angular:directive": {
          "standalone": false
        },
        "@schematics/angular:pipe": {
          "standalone": false
        }
      },
      "root": "",
      "sourceRoot": "src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:application",
          "options": {
            "outputPath": {
              "base": "dist/test.web.application.client",
              "browser": "browser"
            },
            "index": "src/index.html",
            "browser": "src/main.ts",
            "polyfills": [
              "zone.js"
            ],
            "tsConfig": "tsconfig.app.json",
            "assets": [
              "src/assets",
              "src/sitemap.xml",
              "src/sitemaptest.xml",
              "src/sitemap_ca.xml",
              "src/sitemap_es.xml",
              "src/sitemap_en.xml",
              "src/sitemap_fr.xml",
              "src/sitemap_de.xml",
              "src/sitemap_pt.xml",
              "src/sitemap_it.xml",
              "src/robots.txt",
              "src/robots_notracking.txt",
              "src/robots_tracking.txt",
            ],
            "allowedCommonJsDependencies": [
              "moment",
              "jquery",
              "fast-deep-equal",
              "rgbcolor",
              "raf",
              "guid-typescript",
              "core-js/modules/web.dom-collections.iterator.js",
              "core-js/modules/es.string.trim.js",
              "core-js/modules/es.string.starts-with.js",
              "core-js/modules/es.string.split.js",
              "core-js/modules/es.string.replace.js",
              "core-js/modules/es.string.match.js",
              "core-js/modules/es.string.includes.js",
              "core-js/modules/es.string.ends-with.js",
              "core-js/modules/es.regexp.to-string.js",
              "core-js/modules/es.promise.js",
              "core-js/modules/es.array.reverse.js",
              "core-js/modules/es.array.reduce.js",
              "core-js/modules/es.array.iterator.js",
              "core-js/modules/es.array.index-of.js",
              "file-saver",
              "js-sha256"
            ],
            "styles": [
              "src/assets/ion.rangeSlider.min.css",
              "./node_modules/@angular/cdk/_index.scss",           
            ],
            "scripts": [
              "./node_modules/jquery/dist/jquery.min.js",
              "src/assets/js/moment.min.js",
              "src/assets/js/slick.min.js",
              "src/assets/js/jquery.countdown.min.js",
              "src/assets/js/ion.rangeSlider.min.js"
            ],
            "server": "src/main.server.ts",
            "prerender": false,
            "ssr": {
              "entry": "server.ts"
            }
          },
          "configurations": {
            "production": {
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "500kb",
                  "maximumError": "10mb"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "2kb",
                  "maximumError": "4kb"
                }
              ],
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "index": {
                "input": "src/index.prod.html",
                "output": "index.html"
              },
              "outputHashing": "all"
            },
            "development": {
              "optimization": false,
              "extractLicenses": false,
              "sourceMap": true
            }
          },
          "defaultConfiguration": "production"
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "configurations": {
            "production": {
              "buildTarget": "test.web.application.client:build:production"
            },
            "development": {
              "buildTarget": "test.web.application.client:build:development"
            }
          },
          "defaultConfiguration": "development",
          "options": {
            "proxyConfig": "src/proxy.conf.js"
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "buildTarget": "test.web.application.client:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "polyfills": [
              "zone.js",
              "zone.js/testing"
            ],
            "tsConfig": "tsconfig.spec.json",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "src/styles.css"
            ],
            "scripts": [],
            "karmaConfig": "karma.conf.js"
          }
        }
      }
    }
  },
  "cli": {
    "analytics": false
  }
}

帖子版权声明 1、本帖标题:将 Angular 18 SSR 部署到 IIS
    本站网址:http://xjnalaquan.com/
2、本网站的资源部分来源于网络,如有侵权,请联系站长进行删除处理。
3、会员发帖仅代表会员个人观点,并不代表本站赞同其观点和对其真实性负责。
4、本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
5、站长邮箱:yeweds@126.com 除非注明,本帖由chaos在本站《angular》版块原创发布, 转载请注明出处!
最新回复 (0)
返回
作者最近主题: