npm.io
0.0.6 • Published 8 years ago

api-gateway-util

Licence
MIT
Version
0.0.6
Deps
0
Size
7 kB
Vulns
0
Weekly
0
Stars
1

api-gateway-util

Utility for API Gateway.

Installation

npm i api-gateway-util -S

matchBy(resources, options, callback = Array)

This function finds a resource that match by the argument options from resources.

arguments
  • resources
    • An array of resources are returned by getResources of APIGateway.
  • 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.
returning value

If callback is omitted, this function returns the following array.

[err, result]

For the definition of err and result, see the description of callback.

License

MIT

Keywords