This commit is contained in:
Patrick Sy 2024-10-11 12:20:07 +02:00
commit ad6be315de
Signed by: Patrick.Sy
GPG key ID: DDDC8EC51823195E
6 changed files with 182 additions and 0 deletions

21
main.go Normal file
View file

@ -0,0 +1,21 @@
package main
import (
"fmt"
log "github.com/sirupsen/logrus"
"net/http"
)
func main() {
http.HandleFunc("/", helloWorldHandler)
port := 9000
log.Info("Starting on port ", port)
http.ListenAndServe(fmt.Sprint(":", port), nil)
}
func helloWorldHandler(w http.ResponseWriter, r *http.Request) {
log.Info("Request from", r.RemoteAddr)
w.Write([]byte("Hello World"))
}