Skip to content

Instantly share code, notes, and snippets.

@jochasinga
Last active August 29, 2015 14:17
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 jochasinga/8a2e148da7980d124e91 to your computer and use it in GitHub Desktop.
Save jochasinga/8a2e148da7980d124e91 to your computer and use it in GitHub Desktop.
Router for blog API
package main
import mux "github.com/julienschmidt/httprouter"
func NewRouter *mux.Router {
router := mux.New()
for _, route := range routes {
router.Handle(route.Method, route.Pattern, route.Handle)
}
return router
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment