Skip to content

Instantly share code, notes, and snippets.

@treeder treeder/app.go
Created Sep 20, 2016

Embed
What would you like to do?
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
You can’t perform that action at this time.