Created
September 11, 2022 15:28
-
-
Save mstrYoda/8531ae7caf77bda5413bbef4bcdf462f to your computer and use it in GitHub Desktop.
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
func NewServer() { | |
srv := http.Server{ | |
Addr: ":8080", | |
} | |
mux := http.NewServeMux() | |
mux.HandleFunc("/test", func(w http.ResponseWriter, r *http.Request) { | |
w.Write([]byte("OK")) | |
}) | |
srv.Handler = mux | |
go srv.ListenAndServe() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment