【发布时间】:2021-01-28 20:31:56
【问题描述】:
我有默认服务,其 URL 为“https://myprojectid.uc.r.appspot.com”,然后我部署了 .net 核心 webapi,服务名为“mywebapi-poc”,可使用“https:/ /mywebapi-poc-dot-myprojectid.uc.r.appspot.com"
现在我想使用类似这样的 dispatch.yaml 创建路由。 "https://myprojectid.uc.r.appspot.com/mywebapi-poc" 和 "https://myprojectid.uc.r.appspot.com/mywebui-poc" 可以将所有 web api 请求路由到 mywebapi-poc服务和对 mywebui-poc 服务的所有 web ui 请求
我怎样才能让它工作?
dispatch:
- url: "myprojectid.uc.r.appspot.com/"
service: default
- url: "myprojectid.uc.r.appspot.com/mywebapi-poc/*"
service: mywebapi-poc
- url: "myprojectid.uc.r.appspot.com/mywebui-poc/*"
service: mywebui-poc
这样做之后当我这样称呼它https://myprojectid.uc.r.appspot.com/mywebapi-poc/api/v1/WeatherForecast
我得到 404
Angular Web UI 也是如此。第一个 index.html 页面加载,但之后没有加载后续的 Angular 应用程序文件。例如 https://myprojectid.uc.r.appspot.com/mywebui-poc/ 加载 index.html 时响应为 200,但 https://myprojectid.uc.r.appspot.com/mywebui-poc/main.js 未加载,我得到 404。 请注意,我之前使用“/”遇到了路径问题,因此我在 index.html 中将其替换为“/mywebui-poc/”
使用“/”,我可以使单个 UI 服务与 https://mywebui-poc-dot-myprojectid.uc.r.appspot.com 一起工作
【问题讨论】: