Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
// example passing client_id to Express middleware

const express = require('express')
const apiprotect_middleware = require('./apiprotect-express-middlware.js')
const settings = require('settings')

const app = express()                                    

app.use(apiprotect_middleware({"clientId": settings.clientId}))

Step 4: Start the agent

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.