This commit is contained in:
2021-11-07 20:38:39 -06:00
commit 2143481a89
5 changed files with 43 additions and 0 deletions

24
main.go Normal file
View File

@@ -0,0 +1,24 @@
package main
import (
"log"
"net/http"
)
func main() {
mux := http.NewServeMux()
mux.HandleFunc("/heartbeat", func(res http.ResponseWriter, req *http.Request) {
log.Println("Working as expected")
data := []byte("Totally Alive")
res.WriteHeader(200)
res.Write(data)
})
//Create the server.
s := &http.Server{
Addr: ":2122",
Handler: mux,
}
s.ListenAndServe()
}