Dead simple App Engine static hosting
I have no idea why, but I have had tons of trouble finding a simple example for hosting app engine. I have been working on a client-side only site so all I wanted to do was host some static content. I spent way too long figuring it out, so… in this blog post, I’ll cover creating a basic statically hosted site.
Step 1: The App Engine content folder
Create a folder that you will host the files from and place one folder in it, titled static that will contain all of your App Engine files. Your folder structure will look like this:
Place all of the files you want hosted in the static folder.
Step 2: Create your app engine project
Go to the Google app engine site and create an app engine project by clicking the Create Application button. Enter an application identifier, magicalcats for example, and remember your identifier because you’ll need it for the next step.
Step 3: Author the magical app.yaml file
This is usually the first place where I get lost. Instead of bothering with manually doing this, consider the following example from Stack Overflow:
In my particular case, all I would need to do here is replace your-app-name-here with magicalcats.
Step 4: Deploy!
The following command is the simplest form of the appcfg.py command to deploy your app:
appcfg.py -e email@example.com update .
The hamster wheels will spin up on your command prompt and if everything worked, BAM! Static hosted files on appspot under your_app_identifier.appspot.com, or, in my example, magicalcats.appspot.com.
Deploying static files to App Engine is stupid easy, it’s just tricky to navigate the documentation because it’s very much focused to covering EVERYTHING. Have fun and happy hacking!
Google App Engine: The Simplified Static Repo (Thanks Blaine!)