Skip to content

Instantly share code, notes, and snippets.

@oreqizer
Created April 24, 2017 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oreqizer/77223d5b60c5936b5d9447580ed61fd5 to your computer and use it in GitHub Desktop.
Save oreqizer/77223d5b60c5936b5d9447580ed61fd5 to your computer and use it in GitHub Desktop.
Go web server
package main
import (
"log"
"net/http"
)
func main() {
http.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello world"))
})
log.Fatal(http.ListenAndServe(":8080", nil))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment