Skip to content

Hands-on experience with Google Cloud Platform through completion of various labs

Notifications You must be signed in to change notification settings

dennx2/google-cloud-bookshelf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Test the application

Test Locally

To start the HTTP server, in Cloud Shell, run the following command:

cd ~/bookshelf; ~/.local/bin/gunicorn -b :8080 main:app

Test Externally

To start the HTTP server, in Cloud Shell, run the following command:

cd ~/bookshelf; EXTERNAL_HOST_URL="https://8080-$WEB_HOST" ~/.local/bin/gunicorn -b :8080 main:app

There is an environment variable being passed in to the application:

  • EXTERNAL_HOST_URL specifies the scheme and hostname that should be used in the callback URL. If this environment variable is not specified, the redirect_uri passed to Google in the authorization URL will use the hostname that the application sees in incoming URLs: 127.0.0.1:8080, which is localhost. Web Preview forwards requests from the cloudshell.dev URL to localhost (http://127.0.0.1:8080).