Commits

Miki Tebeka  committed cf448fb

starting

  • Participants

Comments (0)

Files changed (22)

+syntax: glob
+
+go-appengine.html
+html = go-appengine.html
+
+all: $(html)
+
+$(html): go-appengine.txt src/*
+	asciidoc -a stylesheet=${PWD}/style.css $<
+
+clean:
+	rm -f $(html)
+
+fresh: clean all
+
+.PHONY: all clean fresh

File go-appengine.txt

+Go On AppEngine
+===============
+:author: Miki Tebeka <miki@adconion.com>
+:backend: slidy
+:max-width: 45em
+:data-uri:
+:icons:
+
+
+Why AppEngine?
+--------------
+"Google App Engine enables you to build web applications on the same scalable
+systems that power Google applications. App Engine applications are easy to
+build, easy to maintain, and easy to scale as your traffic and data storage
+needs grow. With App Engine, there are no servers to maintain: You just upload
+your application, and it's ready to serve to your user."
+
+https://developers.google.com/appengine/whyappengine
+
+
+Disclaimer
+----------
+* I'm not an expert
+* Not a Go expert
+* Not an AppEngine expert
+* This is just me playing around
+* There's probably a better way to do it (TM)
+
+
+A Toy Application - URL Shortener
+---------------------------------
+
+
+Hello AppEngine - Configuration
+-------------------------------
+[source,yaml,numbered]
+---------------------------------------------------
+include::src/1/app.yaml[]
+---------------------------------------------------
+
+Hello AppEngine - Code
+----------------------
+[source,go,numbered]
+---------------------------------------------------
+include::src/1/shortie/shortie.go[]
+---------------------------------------------------
+

File images/icons/callouts/1.png

Added
New image

File images/icons/callouts/10.png

Added
New image

File images/icons/callouts/11.png

Added
New image

File images/icons/callouts/12.png

Added
New image

File images/icons/callouts/13.png

Added
New image

File images/icons/callouts/14.png

Added
New image

File images/icons/callouts/15.png

Added
New image

File images/icons/callouts/2.png

Added
New image

File images/icons/callouts/3.png

Added
New image

File images/icons/callouts/4.png

Added
New image

File images/icons/callouts/5.png

Added
New image

File images/icons/callouts/6.png

Added
New image

File images/icons/callouts/7.png

Added
New image

File images/icons/callouts/8.png

Added
New image

File images/icons/callouts/9.png

Added
New image

File src/1/app.yaml

+application: shortie
+version: 1
+runtime: go
+api_version: go1
+
+handlers:
+- url: /.*
+  script: _go_app

File src/1/run-local.sh

+#!/bin/bash
+# Run server locally
+
+/opt/google_appengine_go/dev_appserver.py . $@

File src/1/shortie/shortie.go

+/* AppEngine demo - a URL shortener */
+package shortie
+
+import (
+	"fmt"
+	"net/http"
+)
+
+func init() {
+	http.HandleFunc("/", rootHandler)
+}
+
+// rootHandler handles the main page.
+func rootHandler(w http.ResponseWriter, r *http.Request) {
+	fmt.Fprintf(w, "Hello AppEngine\n")
+}
+/* Vertical lines between line numbers and code */
+div.linenodiv {
+    border-right:1px solid gray;
+    padding-right:2px;
+    margin-right:2px;
+}