Created
June 17, 2016 20:36
-
-
Save genghisjahn/b04de1092b8a220d08be531d122f9768 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" | |
"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