Remix.run Logo
zelphirkalt 5 days ago

Am I reading this correctly? They are advocating giving up on structuring code in separate files? Is that a scoping problem that NextJS has, which makes it difficult to use multiple files? Seems like a rather ridiculous statement of a framework to make.

wetoastfood 5 days ago | parent [-]

It's the single file that is used to define the middleware function that runs. You can import whatever you want into it and decide how "you should combine [your middleware] into a single file."

qbane 5 days ago | parent | next [-]

As a JavaScript developer, combining/consolidating middlewares manually just defeats the design of middleware. I would rather call it a callback function.

hn_acc_2 5 days ago | parent | prev [-]

I prefer this to having app.use / router.use scattered anywhere throughout the app init (i.e. Express)