Closed joprice closed 1 week ago
If I remember correctly it needs to be one of these types:
Express binding were created / optimised manually a few fears ago.
I plan to try them with Glutinum in the future, but I already know that in the current state the existing bindings are better because Glutinum is missing some key feature yet like https://github.com/glutinum-org/cli/issues/29 https://github.com/glutinum-org/cli/issues/18 and similar things.
Checking out some other libraries, it seems that they make use of structural typing a lot and so don't share common interfaces, but perhaps there's some union or set of overloads that could be used to wrangle the most popular ones so the generated code can be usable without coercions or extra helpers.
I'm curious when combining the bindings for Express in this repo with bindings generated by glutinum-cli, what would the expected types for the
use
function when being called with middleware be? When generating code for express-basic-auth, the middleware function as express's RequestHandler, which seems to map to the typeGlutinum.Express.Express.RequestHandler
. However, I can't seem to calluse
with it to provide the middleware to the application.I can work around this by typing the middleware as
Func<Request, Response, NextFunction, unit>
, but not sure if there should be a common type for sharing middleware bindings.