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

Export lookup #52

Closed
azihsoyn opened this issue Jun 21, 2017 · 2 comments
Closed

Export lookup #52

azihsoyn opened this issue Jun 21, 2017 · 2 comments

Comments

@azihsoyn
Copy link

I'm using goa using httptreemux and kami in same project (under refactoring).

So, I want to handle request which router can handle.

like this

// goa.Router is httptreemux
if goa.Router.Lookup(w, r) {
    goa.Router.ServeHTTP(w, r)
    return
}
kami.ServeHTTP(w, r)

https://github.com/dimfeld/httptreemux/blob/master/router.go#L90

Thanks.

@dimfeld
Copy link
Owner

dimfeld commented Jun 21, 2017

Here's the new API. This allows you to pass the lookup result into the router for serving, without needing to look it up again. I also changed the internal lookup function to not send a response in an error case; this is now handled by the serve function.

if result, found := router.Lookup(w, r); found {
  router.ServeLookupResult(w, r, result)
}

@azihsoyn
Copy link
Author

Thank you so much!!

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