You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
307 B
20 lines
307 B
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
const (
|
|
port = ":8080"
|
|
)
|
|
|
|
func HelloWorld(w http.ResponseWriter, r *http.Request) {
|
|
fmt.Fprintln(w, "Hello, world !")
|
|
}
|
|
|
|
func main() {
|
|
fmt.Printf("Started server on port %v.\n", port)
|
|
http.HandleFunc("/", HelloWorld)
|
|
http.ListenAndServe(port, nil)
|
|
}
|
|
|