Loadmill expressjs recorder middleware
npm install @loadmill/node-recordernode-recorder middleware to capture traffic in their express.js apps. Later they can generate and replay the recording as API tests.Loadmill Tracking Id and use it as loadmillCode option value in expressRecorder.npm i @loadmill/node-recorder --save
Using yarn:
yarn add @loadmill/node-recorder
```
const { expressRecorder } = require('@loadmill/node-recorder');
const app = require('express')();
app.use(expressRecorder({ loadmillCode: process.env.LOADMILL_CODE }));
expressRecorder accepts options object - containing:loadmillCode
* - (REQUIRED). can be retrieved after creating a new application for recording.notSecure
* - (default = false). Optionally you can make recorded traffic not be hashed. cookieExpiration
- (default = 3 minutes = 3 60 * 1000). expressRecorder maintain cookie to define new recording session per uniqueId(user). More about split recording session.basePath
* - (default = https://dummy.domain). Define the protocol://host of your app.
app.use(expressRecorder({
loadmillCode: process.env.LOADMILL_CODE,
notSecure: false,
cookieExpiration: 10 60 1000,
basePath: 'https://loadmill.com'
}));
``