1
0
mirror of https://github.com/golang/go synced 2024-11-18 14:54:40 -07:00
go/cmd/present/appengine.go
Robert Daniel Kortschak f563a1f0f5 go.tools/cmd/present: move dirListTemplate into template file
This change allows the directory front page to be more easily configurable.

Templates are now read only at start-up and stored in a map rather than re-parsed for each page rendering.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/109080044
2014-07-08 15:27:33 +10:00

31 lines
619 B
Go

// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build appengine
package main
import (
"mime"
"code.google.com/p/go.tools/present"
_ "code.google.com/p/go.tools/playground"
)
var basePath = "./present/"
func init() {
initTemplates(basePath)
playScript(basePath, "HTTPTransport")
present.PlayEnabled = true
// App Engine has no /etc/mime.types
mime.AddExtensionType(".svg", "image/svg+xml")
}
func playable(c present.Code) bool {
return present.PlayEnabled && c.Play && c.Ext == ".go"
}