func index(w http.ResponseWriter, req *http.Request) {
	c := appengine.NewContext(req)
	if req.URL.Path != "/" {
		http.Error(w, "not found", http.StatusNotFound)
		return
	}
	w.Header().Set("Content-Type", "text/html; charset=UTF-8")
	err := htmlTemplate.Execute(w, htmlParams{
		Title: "oauth2 proxy",
		Time:  time.Now(),
	})
	if err != nil {
		log.Errorf(c, "Template execution error: %v", err)
		http.Error(w, "template failed", http.StatusInternalServerError)
	}
}
Serve an index page
package main
import (
	"bytes"
	"encoding/base64"
	"encoding/json"
	"errors"
	"flag"
	"html/template"
	"io"
	"io/ioutil"
	golog "log"
	"net/http"
	"net/url"
	"os"
	"strings"
	"time"
	"google.golang.org/appengine"
	"google.golang.org/appengine/log"
	"google.golang.org/appengine/urlfetch"
)
const (
	defaultBindAddress = ":53681"
)
var (
	configFile = flag.String("config", "oauthproxy-config.json", "location of config file")
	config     configData  
)
type configData struct {
	AuthURL              string  
	TokenURL             string  
	ClientID             string  
	ClientSecret         string  
	IncomingClientID     string  
	IncomingClientSecret string  
	Name                 string  
}
var htmlTemplate = template.Must(template.New("index").Parse(`<!doctype html>
<html lang="en">
<head>
 <meta charset="utf-8">
 <title>{{ .Title }}</title>
</head>
<body>
 <h1>{{ .Title }}</h1>
 <p>This is an oauth proxy.</p>
 <p>Current server time is {{ .Time }}.</p>
</body>
</html>
`))
type htmlParams struct {
	Title string
	Time  time.Time
}