3 ms·
> Zero-config would be that those middlewares are enabled by default What middlewares? Next has all basic middlewares needed enabled by default. What you're su
by joshmanders 5y ago
> Zero-config would be that those middlewares are enabled by default
What middlewares? Next has all basic middlewares needed enabled by default. What you're suggesting is that Next ships with every possible middleware that anyone could need, even the special snowflake middleware I want that adds a "foozlebozzle" property to the request context, just to say "We don't require you to do anything" and that's just not possible.
They have made it so you can hook into things and customize if needed, not "you have to now write all your own middleware for everything"
- jeltz 5y agoYes, it is a good thing but I do not see how it is zero config (and generally I do not think zero config is a good thing). Selecting your set of middleware is config.
- dntrkv 5y agoThe zero-config aspect is that in order to add my own middleware to my app, I drop in a file with my middleware function into a directory and that's it. There is nothing else I have to do. Just like if I want to define a new API endpoint, I drop in a file in the corresponding directory with the endpoint function defined and that's it. That's zero config. They took all the ease of the old PHP approach and made it better.