19 lines
346 B
Go
19 lines
346 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
func helloHandler(w http.ResponseWriter, r *http.Request) {
|
|
fmt.Fprintf(w, "Hello, World!")
|
|
}
|
|
|
|
func main() {
|
|
http.HandleFunc("/", helloHandler)
|
|
fmt.Println("Starting server at port 8080")
|
|
if err := http.ListenAndServe(":8080", nil); err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
}
|