1

Google 的 app.yaml 文档提供了示例,但缺少非常简单的基本用法示例: https ://cloud.google.com/appengine/docs/php/config/appconfig#PHP_app_yaml_Static_file_pattern_handlers

假设我有 app.yaml 与 html 文件(例如 cat.html)在同一目录中,它基本上播放来自同一目录中的 wav 文件(例如 catsound.wav)的音频,基本 app.yaml 文件应该是什么? html文件说的是:

<!DOCTYPE html>
<html>
<body>
<audio controls>
  <source src="catsound.wav" type="audio/wav">
Your browser does not support the audio element.
</audio>
</body>
</html>

用户只会去 .appspot.com。没有子网址。为什么以下 app.yaml 不能同时上传 cat.html 和 catsound.wav?:

application: kat
version: 1
runtime: php
api_version: 1
handlers:
- url: /.*
  static_files: cat.*
  upload: cat.*

对于这个如此基本的示例,正​​确的 app.yaml 应该是什么?

4

1 回答 1

0

您需要使用反向引用将 URL 映射到静态文件,例如 \1。我想你想要这样的东西,假设一切都在你的应用程序的根目录中(警告:我没有测试过这个):

- url: /(.*)
  static_files: \1
  upload: cat.*
于 2014-12-01T18:08:35.397 回答