Google App Engine - Hello World in Python
In this post, I am going to try using Google App Engine to run the hello-world app in https://cloud.google.com/appengine/docs/standard/python3/quickstart .
Cloud Function vs App Engine
Unlike AWS equivalents (reference), the hello-world samples are very similar for both Cloud Function and App Engine. Here is the decision tree in case you wonder the difference:
init app
% gcloud app create...
Please enter your numeric choice: 2 (asia-northeast1=Tokyo)
...
Success!
install gcloud component
% gcloud components install app-engine-pythonget sample app
% git clone https://github.com/GoogleCloudPlatform/python-docs-samples
% cd python-docs-samples/appengine/standard_python3/hello_world
% cat main.py
run locally
% pip install -r requirements.txt
% python main.py
% curl http://localhost:8080
deploy
% gcloud app deploy
% gcloud app browse
Comments
Post a Comment