Init
This commit is contained in:
24
main.go
Normal file
24
main.go
Normal 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()
|
||||
}
|
||||
Reference in New Issue
Block a user