user504909
user504909

Reputation: 9549

Google App Engineer, I can not find my css and js files by config static_dir

my files directories is:

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

My app.yaml is:

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

when I visit http://localhost:8080/css/app.css It is still 404 not find error. I read https://cloud.google.com/appengine/docs/python/config/appconfig But still do not know where my error is.

Upvotes: 0

Views: 86

Answers (1)

Alex Martelli
Alex Martelli

Reputation: 882123

Since you have as your first handler:

- url: /.*
  script: main.app

that will match any URL that's requested and send it to main.app -- no other handler is ever consulted!

Just move that stanza to the end of your handlers: section in app.yaml, and you should be fine.

Upvotes: 1

Related Questions