zot*_*guy 39 html hosting google-app-engine web-applications
是否可以在AppEngine上托管静态html网站?以及如何使我的域名与它一起工作?
B.E*_*.E. 48
是的,您可以在AppEngine上托管您的静态文件.只需配置您的app.yaml文件,如下所示
- url: /
static_dir: static_files
Run Code Online (Sandbox Code Playgroud)
并将您的文件放在static_files目录中.这样,每个请求都会路由到您的静态文件.
小智 41
我只是遇到了同样的问题并决定使用这个解决方案...它提供了根目录中的静态文件,如果你不提供文件,则使用index.html.希望有所帮助.
# re-direct to index.html if no path is give
- url: /
static_files: index.html
upload: index.html
# access the static resources in the root director
- url: /(.*)
static_files: \1
upload: (.*)
Run Code Online (Sandbox Code Playgroud)
我编写了一个库来做到这一点,它可以在 AppEngine 或您想要的任何其他服务器上运行:
https://github.com/stochastic-technologies/static-appengine-hoster
您只需将文件放入目录中,它就会托管它们。它还支持 Jinja2 模板、URL 重写和多个域。
| 归档时间: |
|
| 查看次数: |
21810 次 |
| 最近记录: |