简体   繁体   English

使用app.yaml将单个静态文件上传到GAE

[英]Uploading a Single Static File to GAE Using app.yaml

Greetings, 问候,

I am trying to upload two single static files (a CSS & an HTML) to my appspot. 我正在尝试将两个静态文件(CSS和HTML)上传到我的appspot。 However, they're in the root directory. 但是,它们位于根目录中。 I've tried static_dir and static_files but they don't work. 我试过static_dir和static_files,但是它们不起作用。

What I'm trying to do is to upload page.html to /site/ but I have it on root directory because I need it to be on the same dir as my app.yaml. 我想做的是将page.html上传到/ site /,但我将其保存在根目录中,因为我需要将它与app.yaml放在同一目录中。

Here is a portion of my app.yaml: 这是我的app.yaml的一部分:

- url: /page.html
  static_files: /\1.html
  upload: /page.html
- url: /page.css
  static_files: /\1.css
  upload: /page.css

Thank you for taking the time to read this. 感谢您抽出时间来阅读。

\\1 is replaced by the first matched group in the regular expression for the url. \\1替换为url正则表达式中的第一个匹配组。 Your URL has no groups, so it will do nothing. 您的网址没有群组,因此不会执行任何操作。

You can simply do: 您可以简单地执行以下操作:

- url: /page.html
  static_files: page.html
  upload: /page.html
- url: /page.css
  static_files: page.css
  upload: /page.css

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM