Utility for API Gateway.
npm i api-gateway-util -S
This function finds a resource that match by the argument options
from resources
.
-
resources
- An array of resources are returned by
getResources
of APIGateway.
- An array of resources are returned by
-
options.path
- A path of the resource to find.
-
options.method
- A method that the resource to find has.
-
callback(err, result)
- A function called when the search is completed or an error occurs.
-
err
- An error object when an error occurs.
- When successful,
null
passed into this argument.
-
result
- An object of a resource matched by path.
- If not matched,
null
passed into this argument.
If callback
is omitted, this function returns the following array.
[err, result]
For the definition of err
and result
, see the description of callback
.
MIT