google-app-engine


App engine App.yaml. what to include if I want to use a source php file?


I have a search.php file that is supposed to interact with my index.php file for autocomplete. The search.php file content Google Cloud SQL information. In my app.yaml, I have specify the env_variables for cloud SQL, but I am not sure what should I write in app.yaml for the search.php file.
My app.yaml is like:
runtime: php55
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: .*
script: index.php
env_variables:
MYSQL_DSN: mysql:unix_socket=/cloudsql/myprojectexample:us-central1:product;dbname=pd
MYSQL_USER: root
MYSQL_PASSWORD: root
A part of my index.php: (just show you where the search.php going to be used)
<script>
$(function() {
$( "#456" ).autocomplete({
source: 'search.php',
minLength: 3
});
});
</script>
So, how should I include search.php in App.yaml to let it work? so far, the app engine won't interact with Cloud SQL.
thanks!
You can define a handler for your search.php file, and have your .* handler catch everything else. eg
runtime: php55
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /search.php
script: search.php
- url: .*
script: index.php
The handlers will be read in order until a match is found. So any time you try to call search.php it will point to your search.php file, and any time any other file is called it will point to index.php
You can also use the app.yaml file to organise your handlers or endpoints.
eg:
handlers:
- url: /api/search.php
script: search.php
- url: /api/authenticate.php
script: authenticate.php
You can also use this to remove the need for specifying the .php or file extension in the request.
handlers:
- url: /search/.*
script: search.php
Now anytime you call /search or yourappdomain.appspot.com/search you will hit the search page.
You can add as many handlers as you like, but remember they are searched in the order they are written, and as soon as a match is found the match will be executed. So have you catch-all handlers at the end!

Related Links

Google app engine and JPA with Eclipse plug-in
Many-To-Many Relationships in Google App Engine Datastore (ndb)
Is it possible to run Google Omaha on Google App Engine?
Loading request start-up time variation in google app engine?
GAE 1.7.3 - How to debug appengine-web.xml XML error validating
How to setup data fixtures in Google App Engine for Go
How to write a JDO Query to sort result based on long attribute?
GAE doesn't import gflags
Real time notification system on Google App Engine(GAE)
How can I easily get a list of the indexed terms from a search index in the google appengine full text search api in java?
jpa #version on google appengine with #OneToMany: appengine bug or usage error?
How can I delete old backup via cron?
Error on itext-gae.jar
How to get the original from address in a forwarded message in google app engine?
Cannot authorize my google app to access my Cloud SQL instance
GooglePlaces autocomplete - more than one input

Categories

HOME
shell
localization
twitter-bootstrap-3
checkstyle
swt
sublimetext
nuget
simulink
rds
babeljs
jetty
retrofit2
little-proxy
pcl-crypto
minecraft-forge
fhir
libc
scrolltop
event-sourcing
jersey-1.0
gmm
enterprise-miner
breadth-first-search
imagemap
imageresizer
jquery-callback
onload
definitelytyped
outliers
openmdao
tizen-tv
pdw-file-browser
processwire
imx6
getlasterror
parse-tree
naming
linqpad
signal-strength
rfc3339
pom.xml
builder
dotnet-httpclient
launchctl
openblas
er-diagram
bbpress
mouseleave
cpu-cache
rocks
envi
async.js
scaffolding
expectations
spreadjs
exim4
pypiserver
cgi-bin
baasbox
sql-server-data-tools
apache-commons-daemon
git-ftp
openbabel
variadic-templates
theos
beatsmusic
post-commit-hook
wcm
malformedurlexception
maven-scm
accesscontrolexception
visual-studio-express
jammer
rolify
bjyauthorize
midlet
inkcanvas
cgimage
cuteeditor
msr
svk
diagrams
jqueryform
ajax-polling
sifr
spread
lobo-cobra
httpcookie
change-management

Resources

Encrypt Message