1.0.1 • Published 8 years ago

aaf-rapid-connect-mock v1.0.1

Weekly downloads
9
License
MIT
Repository
github
Last release
8 years ago

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);