Skip to content

Instantly share code, notes, and snippets.

@josephspurrier
Created March 21, 2017 04:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephspurrier/f1c656b163ba1961050d6a540d9af4ac to your computer and use it in GitHub Desktop.
Save josephspurrier/f1c656b163ba1961050d6a540d9af4ac to your computer and use it in GitHub Desktop.
Simple Web Server in Go
package main
import (
"io"
"net/http"
)
func main() {
http.HandleFunc("/", index)
http.ListenAndServe(":8080", nil)
}
func index(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "Hello world!")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment