如何在Google App Engine上上传静态HTML网站? [英] How can I upload a static HTML site on Google App Engine?

查看:140
本文介绍了如何在Google App Engine上上传静态HTML网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有关于这个的任何教程?
我的项目中有3个文件:


  • index.html

  • 索引。 css

  • index.js



应该很简单,但到目前为止, 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆