Created
April 5, 2021 06:07
-
-
Save jameshwc/f3c7bfcd53351eeb9002ad574b2ca8c0 to your computer and use it in GitHub Desktop.
nasa midterm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
) | |
func main() { | |
m := http.NewServeMux() | |
m.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | |
w.Write([]byte("hello world")) | |
}) | |
s := http.Server{Addr: ":80", Handler: m} | |
fmt.Println("Server is starting...") | |
if err := s.ListenAndServe(); err != nil { | |
log.Fatal(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment