Basic http program

This commit is contained in:
2023-07-16 14:23:32 +01:00
parent 4e346d8113
commit 6e78a0ec88
2 changed files with 10 additions and 3 deletions

BIN
giacPoints Executable file

Binary file not shown.

11
main.go
View File

@@ -2,8 +2,15 @@ package main
import (
"fmt"
"log"
"net/http"
)
func main() {
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
}
func main() {
http.HandleFunc("/", handler)
log.Fatal(http.ListenAndServe(":8080", nil))
}