开发者

How to declare the welcome file (e.g. index.html) in app.yaml

开发者 https://www.devze.com 2023-01-18 22:37 出处:网络
In Java, the web.xml might contain some <welcome-file> elements. I am trying to do something equivalent in python with no luck.

In Java, the web.xml might contain some <welcome-file> elements. I am trying to do something equivalent in python with no luck.

application: wk
version: 1
runtime: python
api_version: 1

handlers:
- url: /
  static_dir: docs

welcome_files:
- index.html

Any thoughts? I get an error that开发者_Go百科 "welcome_files" is not understood.


One possibility:

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


Robert's answer does not work any more. You have to do the following:

- url: /
  static_files: static/index.html
  upload: static/index.html

- url: /(.*)
  static_files: static/\1
  upload: static/\1


Route the empty string to index.html.

- url: /$
  static_files: static/index.html
  upload: static/index.html

- url: /
  static_dir: static
0

精彩评论

暂无评论...
验证码 换一张
取 消