Alen
Alen

Reputation: 917

Google App Engine (PHP) - How to include javascript

I made website using PHP on LAMP server and now I want to put it on GAE but it seems it can't recognize javascript. This is my yaml file:

application: helloworld
version: 1
runtime: php
api_version: 1

handlers:
- url: /stylesheets
  static_dir: stylesheets

- url: /.*
  script: index.php

- url: /js
  static_dir: js

Then in html I load it like this:

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="js/script.js"></script>

Please help

Upvotes: 0

Views: 1198

Answers (1)

Stuart Langley
Stuart Langley

Reputation: 7054

In the app.yaml file, the first matching URL regular expression will be executed. As you have the catch all .* expression above the /js then it will match the request.

Change the order of you app.yaml to

handlers:

- url: /stylesheets
  static_dir: stylesheets

- url: /js
  static_dir: js

- url: /.*
  script: index.php

Upvotes: 2

Related Questions