LEFT | RIGHT |
1 Copyright 2011 The Go Authors. All rights reserved. | 1 Copyright 2011 The Go Authors. All rights reserved. |
2 Use of this source code is governed by a BSD-style | 2 Use of this source code is governed by a BSD-style |
3 license that can be found in the LICENSE file. | 3 license that can be found in the LICENSE file. |
4 | 4 |
5 godoc on appengine | 5 godoc on appengine |
6 ------------------ | 6 ------------------ |
7 | 7 |
8 Prerequisites | 8 Prerequisites |
9 ------------- | 9 ------------- |
10 | 10 |
11 * Go appengine SDK go1beta4 - 2012-03-14 | 11 * Go appengine SDK |
12 http://code.google.com/p/appengine-go/downloads/list | 12 https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Go |
13 | 13 |
14 * Go sources at tip under $GOROOT | 14 * Go sources at tip under $GOROOT |
15 | 15 |
16 | 16 |
17 Directory structure | 17 Directory structure |
18 ------------------- | 18 ------------------- |
19 | 19 |
20 * Let $APPDIR be the directory containing the app engine files. | 20 * Let $APPDIR be the directory containing the app engine files. |
21 (e.g., $APPDIR=$HOME/godoc-app) | 21 (e.g., $APPDIR=$HOME/godoc-app) |
22 | 22 |
23 * $APPDIR contains the following entries (this may change depending on | 23 * $APPDIR contains the following entries (this may change depending on |
24 app-engine release and version of godoc): | 24 app-engine release and version of godoc): |
25 | 25 |
26 app.yaml | 26 app.yaml |
27 godoc.zip | 27 godoc.zip |
28 godoc/ | 28 godoc/ |
29 index.split.* | 29 index.split.* |
30 | 30 |
31 * The app.yaml file is set up per app engine documentation. | 31 * The app.yaml file is set up per app engine documentation. |
32 For instance: | 32 For instance: |
33 | 33 |
34 application: godoc-app | 34 application: godoc-app |
35 version: 1 | 35 version: 1 |
36 runtime: go | 36 runtime: go |
37 » api_version: go1beta | 37 » api_version: go1 |
38 | 38 |
39 handlers: | 39 handlers: |
40 - url: /.* | 40 - url: /.* |
41 script: _go_app | 41 script: _go_app |
42 | 42 |
43 * The godoc/ directory contains a copy of the files under $GOROOT/src/cmd/godoc | 43 * The godoc/ directory contains a copy of the files under $GOROOT/src/cmd/godoc |
44 with modifications: | 44 with doc.go excluded (it belongs to pseudo-package "documentation") |
45 | |
46 » - doc.go is excluded (it belongs to pseudo-package "documentation") | |
47 » - main.go is excluded (appinit.go is taking its place) | |
48 | 45 |
49 | 46 |
50 Configuring and running godoc | 47 Configuring and running godoc |
51 ----------------------------- | 48 ----------------------------- |
52 | 49 |
53 To configure godoc, run | 50 To configure godoc, run |
54 | 51 |
55 bash setup-godoc-app.bash | 52 bash setup-godoc-app.bash |
56 | 53 |
57 to create the godoc.zip, index.split.*, and godoc/appconfig.go files | 54 to create the godoc.zip, index.split.*, and godoc/appconfig.go files |
58 based on $GOROOT and $APPDIR. See the script for details on usage. | 55 based on $GOROOT and $APPDIR. See the script for details on usage. |
59 | 56 |
60 To run godoc locally, using the app-engine emulator, run | 57 To run godoc locally, using the app-engine emulator, run |
61 | 58 |
62 <path to google_appengine>/dev_appserver.py $APPDIR | 59 <path to google_appengine>/dev_appserver.py $APPDIR |
63 | 60 |
64 godoc should come up at http://localhost:8080 . | 61 godoc should come up at http://localhost:8080 . |
LEFT | RIGHT |