Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only use middleware on certain routes #64

Closed
jerodsanto opened this issue Sep 2, 2014 · 2 comments
Closed

Only use middleware on certain routes #64

jerodsanto opened this issue Sep 2, 2014 · 2 comments

Comments

@jerodsanto
Copy link

Hey there. New to Goji (and Go too, a little) and I'm curious if I can have middleware that runs on some routes and not others? For instance, I want some endpoints (most) to require authentication and a few to be public. An auth middleware makes sense, but how can I selectively use it?

Thanks. loving Goji so far!

@saj1th
Copy link
Contributor

saj1th commented Sep 2, 2014

Please take a look at

https://github.com/zenazn/goji/blob/master/example/main.go#L48

Hope it helps

@jerodsanto
Copy link
Author

That helps, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants