如何在应用程序引擎上设置Angular 4应用程序

如何在应用程序引擎上设置Angular 4应用程序,angular,google-app-engine,google-cloud-platform,angular-cli,Angular,Google App Engine,Google Cloud Platform,Angular Cli,要在app Engine上托管Angular 4应用程序(使用Angular cli构建),我构建了以下内容: service: stage runtime: python27 api_version: 1 threadsafe: true skip_files: - ^(?!dist) # Skip any files not in the dist folder handlers: # Routing for bundles to serve directly - url: /((?:

要在app Engine上托管Angular 4应用程序(使用Angular cli构建),我构建了以下内容:

service: stage
runtime: python27
api_version: 1
threadsafe: true

skip_files:
- ^(?!dist)  # Skip any files not in the dist folder

handlers:
# Routing for bundles to serve directly
- url: /((?:inline|main|polyfills|styles|vendor)\.[a-z0-9]+\.bundle\.js)
  secure: always
  redirect_http_response_code: 301
  static_files: dist/\1
  upload: dist/.*

# Routing for a prod styles.bundle.css to serve directly
- url: /(styles\.[a-z0-9]+\.bundle\.css)
  secure: always
  redirect_http_response_code: 301
  static_files: dist/\1
  upload: dist/.*

# Routing for typedoc, assets and favicon.ico to serve directly
- url: /((?:assets|docs)/.*|favicon\.ico)
  secure: always
  redirect_http_response_code: 301
  static_files: dist/\1
  upload: dist/.*

# Any other requests are routed to index.html for angular to handle so we don't need hash URLs
- url: /.*
  secure: always
  redirect_http_response_code: 301
  static_files: dist/index.html
  upload: dist/index\.html
  http_headers:
    Strict-Transport-Security: max-age=31536000; includeSubDomains
    X-Frame-Options: DENY

如您所见,我只使用静态_文件端点,根本没有涉及python应用程序。我这样做是为了让一个应用程序在谷歌云平台的https下运行。但我发现谷歌文档令人困惑,尤其是当我不知道有什么工具可用时。有更好的方法吗?这种方法有什么缺陷我应该警惕吗?

这些是app engine需要的基本配置

#Configuration of runtime parameters
runtime: custom
env: flex
service: ui-version

handlers:
- url: /.*
  script: this field is required, but ignored
  secure: always  # Require HTTPS

health_check:
  enable_health_check: False
  check_interval_sec: 5
  timeout_sec: 4
  unhealthy_threshold: 2
  healthy_threshold: 2

manual_scaling:
  instances: 1

resources:
  cpu: 1
  memory_gb: 4.0
  disk_size_gb: 20

嘿,罗伯,你有什么最新消息吗?真令人沮丧的是,没有明确的步骤让angular应用程序为GCP应用程序引擎做好准备。我已经离开了这个项目,但其他人似乎喜欢这个解决方案,我不知道为什么不应该使用它。