处理程序找不到appengine static_files

时间:2014-10-15 11:27:37

标签: google-app-engine

application: fooapp
version: 1
runtime: python27
api_version: 1
threadsafe: true

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

- url: /lib
  static_dir : static/lib

- url: /resources
  static_dir : static/resources

- url: /foo.js
  static_files : static/foo.js
  upload: static/upload

通过上面的配置,我可以使用dev_appserver.py在localhost中启动应用程序。它localhost:8080在静态文件夹中提供了index.html。 但是,当我部署应用程序时,fooapp.appspot.com会生成404.我在日志中看到以下消息。 未找到处理程序引用的静态文件:static / index.html

project structure 为什么部署后没有提供index.html文件?我错过了什么?

1 个答案:

答案 0 :(得分:0)

将yaml更改为以下工作。

application: fooapp
version: 1
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /lib
  static_dir : static/lib

- url: /resources
  static_dir : static/resources

- url: /app.js
  static_files : static/app.js
  upload: static/app.js

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