5 ms·
You don't need a router, but it is much more readable with one. You don't need middleware, but it is much more readable with r.Use(jwtVerify) then writing a de
by yur83838 9y ago
You don't need a router, but it is much more readable with one.
You don't need middleware, but it is much more readable with r.Use(jwtVerify) then writing a deeply nested half router with logic.
If you're running a single endpoint, then the router is adding zero value.
- dithering 9y agoReadability is, I think, a function of your expectations. If you're used to seeing a particular incantation, it's readable. Personally (emphasis on the personally, which is my point), I don't think it gets much more readable that a great big switch statement.