aaf-rapid-connect-mock
v1.0.1
Published
Host a local 'mock' instance of AAF Rapid Connect.
Downloads
7
Readme
aaf-rapid-connect-mock
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 tohttps://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 toAAF 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);