Skip to content
Browse files

added favicon.ico

  • Loading branch information...
1 parent e39d65e commit 3dc8d35a0af434fc1ac03a62104bebad2b0df3fd @tux21b committed
Showing with 6 additions and 0 deletions.
  1. +1 −0 chess.html
  2. BIN favicon.ico
  3. +5 −0 main.go
View
1 chess.html
@@ -5,6 +5,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="Play chess with Go, HTML5, WebSockets and random strangers!" />
<link rel="stylesheet" type="text/css" href="/chess.css" />
+ <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<script type="text/javascript" src="chess.js"></script>
<link href='http://fonts.googleapis.com/css?family=Oleo+Script:700' rel='stylesheet' type='text/css'>
</head>
View
BIN favicon.ico
Binary file not shown.
View
5 main.go
@@ -158,6 +158,10 @@ var tmpl = template.Must(template.ParseFiles("chess.html"))
// Serve the index page.
func handleIndex(w http.ResponseWriter, r *http.Request) {
+ if r.URL.Path != "/" {
+ http.Error(w, "Not Found", http.StatusNotFound)
+ return
+ }
if err := tmpl.Execute(w, r.Host); err != nil {
log.Printf("tmpl.Execute: %v", err)
}
@@ -207,6 +211,7 @@ func main() {
http.HandleFunc("/chess.js", handleFile("chess.js"))
http.HandleFunc("/chess.css", handleFile("chess.css"))
http.HandleFunc("/bg.png", handleFile("bg.png"))
+ http.HandleFunc("/favicon.ico", handleFile("favicon.ico"))
http.Handle("/ws", websocket.Handler(handleWS))
go hookUp()

0 comments on commit 3dc8d35

Please sign in to comment.
Something went wrong with that request. Please try again.