【问题标题】:appengine static_files not found by handler处理程序未找到 appengine static_files
【发布时间】:2014-10-15 11:27:36
【问题描述】:

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

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

【问题讨论】:

    标签: google-app-engine


    【解决方案1】:

    将 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-21
      • 2016-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-10
      • 1970-01-01
      相关资源
      最近更新 更多