Skip to content

Instantly share code, notes, and snippets.

@genghisjahn
Created June 17, 2016 20:36
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 genghisjahn/b04de1092b8a220d08be531d122f9768 to your computer and use it in GitHub Desktop.
Save genghisjahn/b04de1092b8a220d08be531d122f9768 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"io"
"net/http"
"github.com/trout"
)
func main() {
var router trout.Router
h := testHandler()
router.Endpoint("/trout/{test}/test").Handler(h)
http.ListenAndServe(":8080", nil)
}
func testHandler() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "--hello--")
fmt.Println(*r.URL)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment