Skip to content

Instantly share code, notes, and snippets.

@khajer
Last active December 15, 2017 04:14
Show Gist options
  • Select an option

  • Save khajer/edc0198c421430cda244cb1119102e64 to your computer and use it in GitHub Desktop.

Select an option

Save khajer/edc0198c421430cda244cb1119102e64 to your computer and use it in GitHub Desktop.
simple go http server.
package main
import (
"fmt"
"net/http"
)
func Handler(writer http.ResponseWriter, request *http.Request) {
fmt.Fprintf(writer, "Hello, world ")
}
func main() {
fmt.Println("Server run at : http://127.0.0.1:8080")
http.HandleFunc("/", Handler)
http.ListenAndServe(":8080", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment