Versions Compared

Key

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

...

Code Block
const express = require('express');
const apiprotect = require('apiprotect');

const app = express();

// Register body parsing middlware then APIProtect middlware
app.use(express.json());
app.use(apiprotect.default()); // ClientId read from ENV: `DT_API_PROTECT_CLIENT_ID`

...

Code Block
languagejs
const express = require('express');
const apiprotect = require('apiprotect');
const settings = require('settings')l

const app = express();

// Register body parsing middlware then APIProtect middlware
app.use(express.json());
app.use(apiprotect.default(settings.clientId)); // ClientId passed as param

...