Sivadass N
Sivadass N

Reputation: 927

Config nested static folder in Google App Engine Standard - PHP environment

I am having the following file structure:

Once deployed, I can access the index.html in root without any problems.

But the index.html inside the folder app gives 404 error for all css and js files.

How to configure the app folders assets correctly in my app.yaml configuration.

And here is my app.yaml:

runtime: php55
api_version: 1
threadsafe: true

skip_files: 
- src/
- node_modules/
- ^(.*/)?#.*#
- ^(.*/)?.*~
- ^(.*/)?.*\.py[co]
- ^(.*/)?.*/RCS/.*
- ^(.*/)?\..*

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

- url: /app/.*
  static_files: public/app/index.html
  upload: public/app/index.html

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

Upvotes: 1

Views: 391

Answers (1)

Dan Cornilescu
Dan Cornilescu

Reputation: 39824

That's because according to the handler matching these files you're uploading the public/app/index.html instead of the respective files:

- url: /app/.*
  static_files: public/app/index.html
  upload: public/app/index.html

You should change the handler to upload the respective file, see the static_files row in the Handlers element table:

- url: /app/(.*\.(html|js|css))$
  static_files: public/app/\1
  upload: public/app/.*\.(html|js|css)$

Upvotes: 2

Related Questions