|
@@ -7,12 +7,15 @@ import (
|
|
|
"github.com/chuangxin1/httprouter"
|
|
|
)
|
|
|
|
|
|
+// Router router
|
|
|
+type Router = httprouter.Router
|
|
|
+
|
|
|
// Handle is a function that can be registered to a route to handle HTTP
|
|
|
// requests. Like http.HandlerFunc.
|
|
|
type Handle func(http.ResponseWriter, *http.Request)
|
|
|
|
|
|
// NewRouter new http router with default route
|
|
|
-func NewRouter() *httprouter.Router {
|
|
|
+func NewRouter() *Router {
|
|
|
router := httprouter.New()
|
|
|
|
|
|
router.NotFound = http.HandlerFunc(notFoundHandler)
|