Created
September 20, 2016 02:27
-
-
Save treeder/ca97fdb9f68df053044103f561d7b76f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"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