在Java中,web.xml可能包含一些<welcome-file>
个元素。我试图在python中做一些相同的事情而没有运气。
application: wk
version: 1
runtime: python
api_version: 1
handlers:
- url: /
static_dir: docs
welcome_files:
- index.html
有什么想法?我收到一条错误,“welcome_files”未被理解。
答案 0 :(得分:7)
一种可能性:
application: wk
version: 1
runtime: python
api_version: 1
handlers:
- url: /
static_files: static/index.html
upload: static/index.html
- url: /.*
static_files: static
upload: static
答案 1 :(得分:1)
- url: /
static_files: static/index.html
upload: static/index.html
- url: /(.*)
static_files: static/\1
upload: static/\1
答案 2 :(得分:0)
将空字符串路由到index.html。
- url: /$
static_files: static/index.html
upload: static/index.html
- url: /
static_dir: static