Created
April 20, 2017 22:25
-
-
Save hashbender/a9b75912773495f612ac09d9addf2080 to your computer and use it in GitHub Desktop.
newrouter
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
//NewRouter returns a new Gorrila Mux router | |
func NewRouter(c AppContext) *mux.Router { | |
router := mux.NewRouter().StrictSlash(true) | |
appContext = c | |
for _, route := range routes { | |
//Check all routes to make sure the users are properly authenticated | |
router. | |
Methods(route.Method...). | |
Path(route.Pattern). | |
Name(route.Name). | |
Handler(route.ContextedHandler) | |
} | |
return router | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment