Comments (4)
Actually, I was able to work around my issue by using a couple more muxs.
from goji.
I know you've found a workaround, but a brief comment on something you mentioned:
subRouter.Abandon(root.NewLoggerMiddleware)
subRouter.UseC(NewLoggerMiddleware)
Unfortunately, this can't possibly work: root.NewLoggerMiddleware
has already happened by the time subRouter
gets a chance to look at the request. The rough mental model here is that sub Muxes are not special at all—they are just Handler
s like everything else—and that middleware always happens immediately before Handler
s execute.
from goji.
@jdoklovic, can you describe your workaround? We are having the same issue.
from goji.
@troylelandshields The work around was to expand everything into their own routers and then apply logging middleware to each sub router. The root router doesn't have logging middleware at all and also has no actual routes other than mapping patterns to sub routers
from goji.
Related Issues (20)
- Problem in running goji "Hello World" HOT 2
- How to get all request parameters in handler?
- Please tag/release the 1.7+ master branch HOT 1
- middleware.Handler(rq.Context()) returns nil HOT 1
- Can't install goji HOT 3
- Missing Object.assing method HOT 1
- go1.7.4 and go1.8: I try to unit test, but panic on pat.Param HOT 1
- Cannot install using glide or gb HOT 7
- go get issue HOT 2
- dispatch.go:6:2: use of internal package not allowed HOT 1
- Rate Limit HOT 1
- Handling application panics and serving a 500 error page HOT 2
- Could pat.Param not panic when it the interface is nil HOT 4
- go modules support ? HOT 5
- [Proposal] consider making `newWithMethods` accessible function HOT 3
- git tags suggest v2, but go.mod disagrees HOT 4
- Nicer errors on requests? HOT 1
- Are patterns broken inside middleware? HOT 1
- how to HTTPS/TLS Web Server with goji ? HOT 1
- Is there a way to pass the regexp that was available in the old goji? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goji.