@@ -5,14 +5,18 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
const (
|
||||
version = "v1.0.0"
|
||||
)
|
||||
|
||||
func main() {
|
||||
mux := http.NewServeMux()
|
||||
|
||||
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write([]byte("Hello, World!"))
|
||||
w.Write([]byte("Hello, World page"))
|
||||
})
|
||||
mux.HandleFunc("/hello", func(w http.ResponseWriter, r *http.Request) {
|
||||
json.NewEncoder(w).Encode(map[string]string{"message": "Hello, World!"})
|
||||
json.NewEncoder(w).Encode(map[string]string{"message": "hello world json!"})
|
||||
})
|
||||
|
||||
http.ListenAndServe(":8080", mux)
|
||||
|
||||
Reference in New Issue
Block a user