16 lines
335 B
Go
16 lines
335 B
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
func main() {
|
|
http.HandleFunc("GET /", func(w http.ResponseWriter, r *http.Request) {
|
|
w.Write([]byte("This was a GET request!"))
|
|
})
|
|
http.HandleFunc("POST /", func(w http.ResponseWriter, r *http.Request) {
|
|
w.Write([]byte("This was a POST request!"))
|
|
})
|
|
http.ListenAndServe(":8000", nil)
|
|
}
|