如何在Google App Engine上上传静态HTML网站? [英] How can I upload a static HTML site on Google App Engine?
问题描述
有没有关于这个的任何教程?
我的项目中有3个文件:
应该很简单,但到目前为止, GAE的文档。
你不需要在app.yaml中分别调出每个文件,相反,这样一个简单的处理程序就足够了:
application:myapp
version:main
runtime: python27
api_version:1
threadsafe:true
处理程序:
- url:/(.*)/
static_files:\ 1 / index。 html
upload:。* / index.html
- url:/.*
static_dir:static
然后将您的网站放在包含 app.yaml
的目录下的一个名为'static'的目录中。
第一个处理程序确保在任何时候有人要求目录时提供 index.html
。第二个处理程序直接从静态目录服务所有其他URL。
Is there any tutorial for this? I have 3 files in my project:
- index.html
- index.css
- index.js
Should be simple, but so far I am lost in huge GAE's documentation.
You don't need to call out each file individually in app.yaml as Mark suggests; instead, a simple handler like this will suffice:
application: myapp
version: main
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /(.*)/
static_files: \1/index.html
upload: .*/index.html
- url: /.*
static_dir: static
Then put your site in a directory called 'static' under the directory containing app.yaml
.
The first handler ensures that index.html
is served up any time someone asks for a directory. The second handler serves all other URLs directly from the static dir.
这篇关于如何在Google App Engine上上传静态HTML网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!