curveball / core

The Curveball framework is a TypeScript framework for node.js with support for modern HTTP features.
https://curveballjs.org/
MIT License
526 stars 7 forks source link

Allow many middlewares to be registered at once. #66

Closed evert closed 4 years ago

evert commented 6 years ago

Change signature of use(mw: Middleware) to use(mw: Middleware|Middleware[])

Nimor111 commented 6 years ago

If this is till relevant i'd like to take a shot at it. 👍

evert commented 6 years ago

I think it's still relevant, but I'm wondering now if this is a better syntax:

use(...mw: Middleware)

This way you could call

 app.use(mw1, mw2);

Instead of:

app.use([mw1, mw2])
Nimor111 commented 6 years ago

Writing it as

app.use(mw1, mw2);

Seems more intuitive yes.

craigmc08 commented 4 years ago

Shouldn't this be closed? It was implemented in #98.

evert commented 4 years ago

Yep you're right!