Deploying Static Site on Google App Engine

Deploying static app on AWS is a bit involved. You have to setup Route 53 and upload the files to S3 and configure it as a Web Server. Google App Engine is a bit easier.

Step 1

Create a new app from the Google cloud console

Step 2

Download the Google Cloud SDK for your OS and install by running the install.sh.

Step 3

Create a directory named as your app id. The html files will be within the www directory, the css files will be inside www/css folder:

codingskill-238523/www/css/main.css
codingskill-238523/www/index.html

Step 4

Create a app.yaml file inside the app id folder:


runtime: python27

api_version: 1

threadsafe: true

handlers:

- url: /

  static_files: www/index.html

  upload: www/index.html

- url: /(.*)

  static_files: www/\1

  upload: www/(.*)

You don't need to specify the CSS file directory or the files in the app.yaml file. It takes a few minutes for any changes to be seen in the browser.

Step 5

Run the following command from within the root directory of your application where the app.yaml file is located:

gcloud app deploy

View the deployed static site and profit! Things have changed a bit since I deployed a static app on Google cloud few years ago. But, it took me only 30 minutes to deploy my static app.


Related Articles


Ace the Technical Interview

  • Easily find the gaps in your knowledge
  • Get customized lessons based on where you are
  • Take consistent action everyday
  • Builtin accountability to keep you on track
  • You will solve bigger problems over time
  • Get the job of your dreams

Take the 30 Day Coding Skills Challenge

Gain confidence to attend the interview

No spam ever. Unsubscribe anytime.