package main
import (
"fmt"
"log"
"net/http"
"os"
)
func main() {
http.HandleFunc("/", HelloServer)
http.ListenAndServe(":8080", nil)
}
func HelloServer(w http.ResponseWriter, r *http.Request) {
dir, err := os.Getwd()
if err != nil {
log.Fatal(err)
}
fmt.Fprintf(w, "Hello, %s!", dir)
}
No comments:
Post a Comment