Skip to content

Instantly share code, notes, and snippets.

@harshitanand
Last active August 4, 2017 12:04
Show Gist options
  • Save harshitanand/03df81346aba933b6cb5752cd6f479ad to your computer and use it in GitHub Desktop.
Save harshitanand/03df81346aba933b6cb5752cd6f479ad to your computer and use it in GitHub Desktop.
Simple application written in Golang
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 3000")
log.Fatal(http.ListenAndServe(":3000", 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