Skip to content

Commit

Permalink
Add more info in home page.
Browse files Browse the repository at this point in the history
  • Loading branch information
toomore committed Apr 21, 2015
1 parent a33f49d commit 5dc44c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tradingdays/tradingdays_server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"encoding/json"
"flag"
"fmt"
"log"
"net/http"
"strconv"
Expand All @@ -18,7 +19,11 @@ func Log(req *http.Request) {

// Home is home page.
func Home(w http.ResponseWriter, req *http.Request) {
w.Write([]byte("Hello World"))
w.Header().Set("Content-Type", "text/html; charset=utf-8")
w.Write([]byte("查詢台灣股市是否開市<br>"))
w.Write([]byte(fmt.Sprintf("<a href=\"/open?q=%d\">範例</a><br>", time.Now().Unix())))
w.Write([]byte("[<a href=\"https://godoc.org/github.com/toomore/gogrs/tradingdays\">Docs</a>] [<a href=\"https://github.com/toomore/gogrs/blob/master/tradingdays/tradingdays_server/main.go\">github</a>]<br>"))

Log(req)
}

Expand Down

0 comments on commit 5dc44c9

Please sign in to comment.