22 lines
301 B
Go
22 lines
301 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"log"
|
||
|
"net/http"
|
||
|
)
|
||
|
|
||
|
func getRoot(w http.ResponseWriter, r *http.Request) {
|
||
|
fmt.Printf("Received connection\n")
|
||
|
fmt.Fprintln(w, "Hello!")
|
||
|
}
|
||
|
|
||
|
func main() {
|
||
|
http.HandleFunc("/", getRoot)
|
||
|
|
||
|
err := http.ListenAndServe(":8080", nil)
|
||
|
if err != nil {
|
||
|
log.Fatal(err)
|
||
|
}
|
||
|
}
|