It seems you can’t add routes in between two filte...
# http4k
n
It seems you can’t add routes in between two filters. In my case I want a certain filter to be skipped for a few routes. Is there a way to do that? Only apply a Filter to a couple routes out of many?
d
Nope. You'll have to apply the filter individually, or wrap everything and come up with another way to discriminate. What was your use case?
n
Previously I had an auth filter that would return 401 unless the user passed a specific token. But then I realized there are a few endpoints (mostly health ones) that need to be accessible unathenticated. So I changed it so the auth endpoint now sets a boolean flag, and only checks it for the endpoints that actually do things.
d
Best thing here is to split the API into route block sections and then some filters to the ones you want protected