【发布时间】:2018-05-22 12:39:53
【问题描述】:
我正在尝试为原本是 Python 的 Google 应用创建一个静态 html 组件(可以离线使用)。
我似乎无法为此正确配置 app.yaml 文件。
handlers:
# Serve images and JSON as static resources.
- url: /(.+\.(gif|png|jpg|json|ico))$
static_files: \1
upload: .+\.(gif|png|jpg|json|ico)$
application_readable: true
- url: \/(static)\/(index)\.html
static_files: static/\1/index.html
upload: static\/index.html
- url: /
script: roomusage.app
login: required
secure: always
- url: /welcome
script: roomusage.app
login: required
secure: always
- url: /record
script: record_usage.app
login: required
secure: always
这是我收到的错误消息:
appcfg.py: error: Error parsing C:\gcloud\dev-myapp\app.yaml: Unable to assign value '\/(static)\/(index)\.html' to attribute 'url':
Value '\/(static)\/(index)\.html' for url does not match expression '^(?:(?!\^)/.*|\..*|(\(.).*(?!\$).)$'
in "C:\gcloud\dev-myapp\app.yaml", line 25, column 8.
2017-12-08 09:27:50 (Process exited with code 2)
【问题讨论】:
-
\/(static)\/(index)\.html模式可能是可疑的。您尝试与哪些 URL 匹配,您想在其中识别哪些参数? -
我正在尝试匹配的网址:
/static/index.html(不明白问题的第二部分)
标签: python google-app-engine static app.yaml