OLD | NEW |
1 package main | 1 package main |
2 | 2 |
3 import ( | 3 import ( |
4 "encoding/json" | 4 "encoding/json" |
5 "flag" | 5 "flag" |
6 "fmt" | 6 "fmt" |
7 ehtml "html" | 7 ehtml "html" |
8 "html/template" | 8 "html/template" |
9 "math/rand" | 9 "math/rand" |
10 "net/http" | 10 "net/http" |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 fileServer := http.FileServer(http.Dir("./")) | 1053 fileServer := http.FileServer(http.Dir("./")) |
1054 return func(w http.ResponseWriter, r *http.Request) { | 1054 return func(w http.ResponseWriter, r *http.Request) { |
1055 w.Header().Add("Cache-Control", string(300)) | 1055 w.Header().Add("Cache-Control", string(300)) |
1056 fileServer.ServeHTTP(w, r) | 1056 fileServer.ServeHTTP(w, r) |
1057 } | 1057 } |
1058 } | 1058 } |
1059 | 1059 |
1060 func main() { | 1060 func main() { |
1061 common.InitWithMetrics("skiaperf", *graphiteServer) | 1061 common.InitWithMetrics("skiaperf", *graphiteServer) |
1062 Init() | 1062 Init() |
1063 » db.Init(db.ProdDatabaseConfig(*local)) | 1063 » db.Init(db.DatabaseConfig(*local)) |
1064 stats.Start(nanoTileStore, git) | 1064 stats.Start(nanoTileStore, git) |
1065 alerting.Start(nanoTileStore, *apikey) | 1065 alerting.Start(nanoTileStore, *apikey) |
1066 | 1066 |
1067 // By default use a set of credentials setup for localhost access. | 1067 // By default use a set of credentials setup for localhost access. |
1068 var cookieSalt = "notverysecret" | 1068 var cookieSalt = "notverysecret" |
1069 var clientID = "31977622648-1873k0c1e5edaka4adpv1ppvhr5id3qm.apps.google
usercontent.com" | 1069 var clientID = "31977622648-1873k0c1e5edaka4adpv1ppvhr5id3qm.apps.google
usercontent.com" |
1070 var clientSecret = "cw0IosPu4yjaG2KWmppj2guj" | 1070 var clientSecret = "cw0IosPu4yjaG2KWmppj2guj" |
1071 var redirectURL = fmt.Sprintf("http://localhost%s/oauth2callback/", *por
t) | 1071 var redirectURL = fmt.Sprintf("http://localhost%s/oauth2callback/", *por
t) |
1072 if !*local { | 1072 if !*local { |
1073 cookieSalt = metadata.MustGet(COOKIESALT_METADATA_KEY) | 1073 cookieSalt = metadata.MustGet(COOKIESALT_METADATA_KEY) |
(...skipping 26 matching lines...) Expand all Loading... |
1100 http.HandleFunc("/compare/", autogzip.HandleFunc(compareHandler)) | 1100 http.HandleFunc("/compare/", autogzip.HandleFunc(compareHandler)) |
1101 http.HandleFunc("/calc/", autogzip.HandleFunc(calcHandler)) | 1101 http.HandleFunc("/calc/", autogzip.HandleFunc(calcHandler)) |
1102 http.HandleFunc("/help/", autogzip.HandleFunc(helpHandler)) | 1102 http.HandleFunc("/help/", autogzip.HandleFunc(helpHandler)) |
1103 http.HandleFunc("/oauth2callback/", login.OAuth2CallbackHandler) | 1103 http.HandleFunc("/oauth2callback/", login.OAuth2CallbackHandler) |
1104 http.HandleFunc("/logout/", login.LogoutHandler) | 1104 http.HandleFunc("/logout/", login.LogoutHandler) |
1105 http.HandleFunc("/loginstatus/", login.StatusHandler) | 1105 http.HandleFunc("/loginstatus/", login.StatusHandler) |
1106 | 1106 |
1107 glog.Infoln("Ready to serve.") | 1107 glog.Infoln("Ready to serve.") |
1108 glog.Fatal(http.ListenAndServe(*port, nil)) | 1108 glog.Fatal(http.ListenAndServe(*port, nil)) |
1109 } | 1109 } |
OLD | NEW |