Angular pwa,如何使http服务器(在localhost:8080上运行)与在localhost:3333上运行的nodejs服务器一起使用?

Don*_*ant 7 proxy angular angular-pwa

当我在端口 3330 上提供 Web 应用程序时,我可以使用 --proxy ./src/proxy.config.json 使 Web 应用程序在端口 3333 上工作,但我不知道如何使 http-server 工作以同样的方式

"start": "ng serve -o --port 3330 --watch --proxy-config ./src/proxy.config.json",
"pwa": "http-server -p 8080 -c-1 dist/satoshi-pwa --proxy http://localhost:3333",
Run Code Online (Sandbox Code Playgroud)

proxy.config.json:

{
  "/api": {
    "target": "http://localhost:3333",
    "secure": false,
    "changeOrigin": true,
    "pathRewrite": {
      "^/api": "/"
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

环境.ts:

export const environment = {
  production: true,
  apiUrl: 'http://localhost:3333/api'
};
Run Code Online (Sandbox Code Playgroud)