new API(lifted, dataScrub, onsuccess, onfailure)
lib/API.js, line 21
Represent a lifted API
Instances of this class are created internally for you. You don't need to use this constructor directly.
| Name | Type | Description |
|---|---|---|
lifted |
external:lift-it.Lifted | |
dataScrub |
Array.<RegExp> | |
onsuccess |
function | nullable |
onfailure |
function | nullable |
Members
-
endpointByUrlObject.<Endpoint>
-
The map from url to an Endpoint instance
-
endpointsArray.<Endpoint>
-
-
maxVersionnumber
-
-
minVersionnumber
-
-
routerexternal:express.Router
-
-
versionsArray.<string>
-
The list of supported versions, ordered from oldest to newest. Example:
['v3', 'v4']
Methods
-
run(url, body, runInfo, callback)
lib/API.js, line 83 -
Execute an endpoint in this api
Name Type Default Description urlstring like '/v1/user/create' or '/v-last/user/create'
bodyObject runInfoObject {} optional data available as
process.domain.runInfo. See more info in run-it moduleName Type Default Description beginTimenumber Date.now() optional requestIdstring genId() optional callbackfunction async cb(out)