aaf-rapid-connect-mock

1.0.1 • Public • Published

aaf-rapid-connect-mock NPM version Build status

Host a local "mock" instance of AAF Rapid Connect.

Installation

Install the package with NPM:

$ npm install aaf-rapid-connect-mock

Usage

Example:

import mockRapidConnect from "aaf-rapid-connect-mock";
 
let options = { ... };
mockRapidConnect(options).listen(3000);

As shown, the package exposes a function that returns an Express application instance. The following options can be specified:

  • jwtSecret – The secret key used to sign JWTs. Required!
  • appUrl – The main entry point URL of the application. Defaults to https://example.com.
  • authUrl – The callback URL that JWTs are sent to on sign-in. Defaults to /auth.
  • pageTitle – The title of the sign-in page. Defaults to AAF Rapid Connect.

Tip

To integrate the package into an existing Express application, simply mount it at a path:

import express from "express";
import mockRapidConnect from "aaf-rapid-connect-mock";
 
let app = express();
 
if (process.env.NODE_ENV !== "production") {
  let jwtSecret = "secret";
  app.use("/mock", mockRapidConnect({ jwtSecret }));
}
 
app.listen(3000);

Package Sidebar

Install

npm i aaf-rapid-connect-mock

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • dstil-admin
  • dstil-dev