u
This commit is contained in:
1 parent
5ef02d648a
commit
a07052e4ca
8 files changed
+111
-6
No files matched your search
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func helloHandler(w http.ResponseWriter, r *http.Request) {
|
||||
_, err := fmt.Fprintf(w, "Hello, world!")
|
||||
if err != nil {
|
||||
log.Printf("write response error: %v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", helloHandler)
|
||||
|
||||
err := http.ListenAndServe(":8081", nil)
|
||||
|
||||
if err != nil {
|
||||
log.Fatalf("server start failed: %v", err)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user