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:

https://cloud.google.com/blog/products/compute/choosing-the-right-compute-option-in-gcp-a-decision-tree


init app

% gcloud app create

...

Please enter your numeric choice: 2 (asia-northeast1=Tokyo)

...

Success!


install gcloud component

% gcloud components install app-engine-python


get 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

Popular posts from this blog

Selenide: Quick Start

Minikube Installation for M1 Mac

Server Testing Tools: Serverspec, InSpec, Testinfra, Goss