...
To install API Protect the provided NodeJS package must be added as a dependency, typically by adding it to a package.json
file. Here is an example of how to add the package:
Example adding dependency to
...
via npm
Code Block |
---|
|
npm link ./apiprotect |
Example adding dependency to via yarn
Code Block |
---|
|
yarn add file:./apiprotect |
Step 2: Add the middleware to the application
...
The NodeJS middleware communicate with an agent process running in the same VPC via HTTP. The agent binary should be executed along with the NodeJS application, and it must be reachable via HTTP from the NodeJS application.
Example API Protect agent usage
Code Block |
---|
usage: data-theorem [-h] [--agent-name AGENT_NAME] [--address ADDRESS]
[--port PORT]
API Protect Extension
optional arguments:
-h, --help show this help message and exit
--client-id CLIENT-ID client Id default env DT_API_PROTECT_CLIENT_ID
--address ADDRESS host the API Protect API should listen on default 127.0.0.1
--port PORT port the API Protect API should listen on default 31337
|
Example executing API Protect agent