Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine 是否可以在google app engine中托管静态html网站?_Google App Engine_Static - Fatal编程技术网

Google app engine 是否可以在google app engine中托管静态html网站?

Google app engine 是否可以在google app engine中托管静态html网站?,google-app-engine,static,Google App Engine,Static,如何设置默认根网页的index.html application: dfischerdna version: 1 runtime: python api_version: 1 handlers: - url: / static_dir: static_files 当访问者输入 然而,我希望当他输入这个时,index.html网页会显示出来。 ->转到404页这可能会对您有所帮助: handlers: - url: / static_files: path/to/in

如何设置默认根网页的index.html

application: dfischerdna version: 1
 runtime: python api_version: 1

 handlers:

 - url: /   
   static_dir: static_files
当访问者输入

然而,我希望当他输入这个时,index.html网页会显示出来。
->转到404页

这可能会对您有所帮助:

handlers:
- url: /
  static_files: path/to/index.html
  upload: local/path/to/index.html
- url: /(.+)
  static_files: path/to/\1
  upload: local/path/to/(.+)
第一个url部分将匹配根url并提供
path/to/index.html
。第二个将匹配根路径以外的任何路径,并提供位于请求URI匹配的
path/to
下的文件。对于URL
http://yourapp.appspot.com/index.html
它将提供
path/to/index.html
,以及类似
http://yourapp.appspot.com/foo/bar.html
它将提供
path/to/foo/bar.html


upload指令告诉GAE要上载哪些本地文件作为应用程序实例中的静态文件。

使用
static\u files
指令,您还需要提供
upload
指令来告诉appcfg.py您要上载哪些文件。如何编写upload指令?@Wobble@unknown Right,我忘了。upload指令的一个示例:handlers:-url:static_files:path/to/index.html static_files:path/to/index.html upload:local/path/to/index.html-url:static_files:path/to/(.+)static_files:path/to/\1 upload:local/path/to/(.+)这在本地上的开发模式下很有效,但当我将它部署到生产环境时,我会得到“未找到处理程序引用的静态文件:“…有什么想法吗?这里可能有什么问题?好主意。这比使用memcache中的字符串生成响应快5倍。”。