【问题标题】:Cypress bad gateway赛普拉斯坏网关
【发布时间】:2019-01-23 10:55:48
【问题描述】:

我已在本地启动我的应用程序,并在 http://localhost:3000 上正常访问它 但是当试图通过 cypress 工具访问它时,我得到 502 bad gateway。任何人都知道为什么这与它在 Chrome 中可以正常访问它不同吗?

【问题讨论】:

    标签: cypress


    【解决方案1】:

    在 localhost 中运行 Angular 应用程序时遇到了同样的问题。应用程序在 chrome 中运行,但不在 cypress 工具中运行,出现 502 bad gateway 错误。我通过 ng-build 命令构建了 Angular 应用程序,并使用命令 http-server -p 4200 -c-1 dist/your_poject_name 提供服务。运行 http-server 命令时,得到如下: 启动 http-server,服务 dist 适用于:

    http://10.132.14.98:4200

    http://127.0.0.1:4200

    在 cy.visit 中使用 url http://10.132.14.98:4200,现在不会出现错误的网关错误。问题在于在 url 中使用 127.0.0.1 或 localhost。除了 localhost 和 127.0.0.1 以外的任何东西都可以。希望这些信息对您有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-23
      • 1970-01-01
      • 2020-08-15
      • 1970-01-01
      • 2023-01-19
      • 1970-01-01
      • 2018-04-28
      • 2023-01-12
      相关资源
      最近更新 更多