我的默认应用程序是否必须部署到 appspot.com?

Does my default app have to be deployed to appspot.com?

我问了一个关于默认应用程序的问题,因为它与应用程序引擎上的微服务有关,得到了 ,但我还有另一个相关问题。

我的默认应用是否必须可以通过 appspot.com 访问?当我 运行 部署命令时,它就放在它的位置,但我宁愿它不能像那样访问。我真的只想要一个满足默认应用程序要求的半空(如 hello world 大小)应用程序。

似乎 Google 正在强行 multi-app/microservices 进入一个环境,该环境最初设置为仅服务于由其他模块支持的单个面向 Web 的应用程序。看起来很不优雅和hacky。

您可以根据使用的 URL 自定义您的应用以实现不同的性能。

例如,您可以使用 domain specific routes with webapp2 或者您可以通过检查 self.request.url 的值并相应地响应来检查处理程序中的域。

例如,您可以 myapp.appspot.com return 404 但 www.mydomain.com 向用户提供内容。

这取决于你"accessible"的意思。

是的,根据 Routing via URL 规则,该应用程序将出现在 appspot.com 上,因为请求可以到达您应用程序内某些服务的某个版本的某个实例,最通用的是:

Sends a request to the named service, version, and instance:

https://instance-dot-version-dot-service-dot-app-id.appspot.com
http://instance.version.service.my-custom-domain.com

此外,来自 Default service

The default service is defined by explicitly giving a service the name "default," or by not including the name parameter in the service's config file. Requests that specify no service or an invalid service are routed to the default service. You can designate a default version for a service, when appropriate, in the Google Cloud Platform Console versions tab.

但是您的应用代码如何响应此类请求完全取决于您。例如,如果您不希望它做任何其他事情,您的默认服务处理程序只会返回 404 或您的 "Hello world" 页面。就好像它不会在那里一样。但它仍然充当默认服务的角色。