|
|
|
|
|
by bbrennan
4077 days ago
|
|
That's exactly the problem I was trying to solve. I wanted to offload CRUD to the library, but use middleware when I need features that aren't as simple as CRUD operations. Check out the middleware and extended usage sections for examples of how it can be extended to do things like access control and regex search. Baucis looks neat, I'll have to dig into the docs some more. |
|
My experience regarding building route logic into middleware is that it starts to break down as you add more complicated logic (Real-time support, webhooks, integration with a taskqueue, etc). This is mainly because the middleware pattern works best when it performs an atomic piece of common logic for a large number of routes.
However, when you start using middleware and binding it to a specific route, for a specific collection, you quickly end up with a situation where for any given route, you can no longer look at a single function and parse the flow of logic.
Also, I find these libraries deceptively simple. They may be great for your private weekend blog, but fail to address the major pain points of API implementation in a production setting:
Now I'm not saying your library needs to cover all of these pain points, but I challenge you to address all of them using a middleware-based architecture while still maintaining your sanity :)Just my2c. The project looks great and hope you keep going with it and that I've provided some helpful feedback.
Cheers!