blob: 0f6593fe8e9cf50a761b8295df6ddd52db8b32a4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
package main
import (
"fmt"
"net/http"
)
func init() {
router.HandleFunc("/", hello)
router.HandleFunc("/version", version)
}
func hello(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "Hello world!")
}
func version(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, versionTxt)
}
|