diff --git a/app.yaml b/app.yaml index cbc230b..c602929 100644 --- a/app.yaml +++ b/app.yaml @@ -6,14 +6,17 @@ api_version: go1 default_expiration: "7d" handlers: + +# Keep these static file handlers in sync with gotour/local.go. - url: /favicon.ico static_files: static/img/favicon.ico upload: static/img/favicon.ico - url: /content/img static_dir: content/img -- url: /static/ +- url: /static static_dir: static application_readable: true + - url: /(.*|list|lesson/.*|compile|fmt|script\.js) script: _go_app diff --git a/gotour/local.go b/gotour/local.go index a6510a1..b312ed9 100644 --- a/gotour/local.go +++ b/gotour/local.go @@ -100,10 +100,16 @@ func main() { } http.HandleFunc("/", rootHandler) - http.Handle("/static/", http.FileServer(http.Dir(root))) http.HandleFunc("/lesson/", lessonHandler) http.Handle(socketPath, socket.Handler) + // Keep these static file handlers in sync with ../app.yaml. + static := http.FileServer(http.Dir(root)) + http.Handle("/content/img/", static) + http.Handle("/static/", static) + imgDir := filepath.Join(root, "static", "img") + http.Handle("/favicon.ico", http.FileServer(http.Dir(imgDir))) + go func() { url := "http://" + httpAddr if waitServer(url) && *openBrowser && startBrowser(url) { diff --git a/static/css/app.css b/static/css/app.css index 8d79676..af642c8 100755 --- a/static/css/app.css +++ b/static/css/app.css @@ -273,7 +273,7 @@ ul { left: 0; width: 50%; overflow: hidden; - background-image: url(/img/gopher.png); + background-image: url(/static/img/gopher.png); background-repeat: no-repeat; background-position: bottom; background-color: #fafafa;