0

我的文件目录是:

helloboard:
|--bower_components
|   |--jquery
|         |--lotsof.js
|--css
|   |--app.css
|--js
|   |--app.js
|   |--someother.js
|--app.yaml
|--index.html
|--main.py

我的 app.yaml 是:

application: helloboard
version: 1
runtime: python27
api_version: 1
threadsafe: yes

handlers:


- url: /.*
  script: main.app

- url: /css/*
  static_dir: css
  expiration: "364d"

- url: /js
  static_dir: js

- url: /bower_components
  static_dir: bower_components

当我访问http://localhost:8080/css/app.css 仍然是 404 not find 错误。我阅读了https://cloud.google.com/appengine/docs/python/config/appconfig 但仍然不知道我的错误在哪里。

4

1 回答 1

1

因为你有你的第一个处理程序:

- url: /.*
  script: main.app

这将匹配任何请求的 URL 并将其发送到main.app- 从未咨询过其他处理程序!

只需将该节移到 中的部分末尾,就可以了。handlers:app.yaml

于 2015-01-30T06:03:00.080 回答