Skip to content

Instantly share code, notes, and snippets.

@treeder
Created July 31, 2015 00:16
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 treeder/554d16f8677122316bff to your computer and use it in GitHub Desktop.
Save treeder/554d16f8677122316bff to your computer and use it in GitHub Desktop.
Simple web server using Gorilla.
package main
import (
"fmt"
"log"
"net/http"
"github.com/treeder/easy-go-in-docker/Godeps/_workspace/src/github.com/gorilla/mux"
)
func main() {
r := mux.NewRouter()
r.HandleFunc("/", Hello)
http.Handle("/", r)
fmt.Println("Starting up on 8080")
log.Fatal(http.ListenAndServe(":8080", nil))
}
func Hello(w http.ResponseWriter, req *http.Request) {
fmt.Fprintln(w, "Hello world!")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment