Function: splitRouteArgs()
splitRouteArgs(
args):object
Defined in: service-core/src/http/MiddlewareChain.ts:130
Splits a route registration's variadic argument list into its optional leading HttpRouteOptions
and the actual RequestHandler list. Shared by both HttpRouter (uWS) and BunRouter so a route
can be registered as either app.post(path, handler1, handler2) (no options — the overwhelmingly
common case, completely unaffected) or app.post(path, { streamingBody: true }, handler1).
Detection is purely by type: RequestHandlers are always functions, so a non-function first
element can only be an options object. This never misfires against a real handler.
Parameters
args
(HttpRouteOptions | RequestHandler)[]
Returns
object
handlers
handlers:
RequestHandler[]
options
options:
HttpRouteOptions