python - 在 Google Appengine 的 app.yaml 中定义查询参数

标签 python google-app-engine app.yaml

我想根据查询参数提供静态文件。更具体地说,我想为搜索引擎优化提供预呈现的快照。这些页面托管在 Google Appengine 上,因此我使用 app.yaml 来定义这些 url。

handlers:
# Consider anything matching a dot static content.
- url: /(.*\..*)$
  static_files: dist/\1
  upload: dist/(.*\..*)$

# Serve snapshots for seo
- url: /?_escaped_fragment_=(.*)
  static_files: dist/snapshots/\1
  upload: dist/(.*)$

# Otherwise let Angular handle it.
- url: /(.*)
  static_files: dist/index.html
  upload: dist/index.html

但是,当我使用查询参数 _escaped_fragment_ 获取 url 时,会触发最后一个 url 处理程序。是否可以在 url 中定义查询参数?如果是这样,我做错了什么?

最佳答案

我很高兴被证明是错误的,但我很确定在通过 app.yaml 调度时不会考虑查询参数。

关于python - 在 Google Appengine 的 app.yaml 中定义查询参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22018142/

相关文章:

java - 如何将自定义对象传递到应用程序引擎端点

google-app-engine - App Engine 忽略我的源代码更新和我的 app.yaml 文件

python - APP.YAML:在 app.yaml 中组合不同的 URL - 相同文件、静态文件服务和源代码访问

python - 在子目录 Python 中创建文件?

python - 将二值图像分成 'blocks'个像素数据

google-app-engine - 如何在 Golang 中创建和渲染基本模板?

node.js - 谷歌应用程序引擎如何控制实例nodejs的数量

Python Twisted JSON RPC

python - 找到 x,其中 y 最小

python - 在 Google App Engine 中使用子过滤器/查询