0.2.4 • Published 8 years ago
express-recall v0.2.4
Recall
Installation
$ npm install --save express-recall
# OR
$ yarn add express-recallUsage
The express-recall module is used as any other express middleware; using the .use() function on your app instance.
import express from 'express'
import recall from 'express-recall'
const options = { ... }
const app = express()
app.use(recall.configure(options))
...Options RecallConfig
| Property | Type | Description | Default |
|---|---|---|---|
| fileName | string | name of the log file that is created | 'recall.express.log' |
| active | boolean | whether the middleware is active at load | true |
| capacity | number | max # of requests to log before suspending | 300 |
API
.configure(options: RecallConfig)
Configures the Recall middleware instance and returns the middleware function to be set in the Express.use function when initializing your Express server
.suspend()
Temporarily disable request logging until specified.
.resume()
Enabled request logging after being suspended or deactivated.