Skip to content

Instantly share code, notes, and snippets.

@wallrat
Created January 11, 2017 12:47
Show Gist options
  • Save wallrat/dd38374f9575041846d95b8a72b56b91 to your computer and use it in GitHub Desktop.
Save wallrat/dd38374f9575041846d95b8a72b56b91 to your computer and use it in GitHub Desktop.

Revisions

  1. wallrat created this gist Jan 11, 2017.
    16 changes: 16 additions & 0 deletions hello-http.go
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    package main

    import (
    "fmt"
    "log"
    "net/http"
    )

    func main() {

    http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintf(w, "Hello world!")
    })

    log.Fatal(http.ListenAndServe(":8081", nil))
    }