From f9e9cf16dfc0a1bdeec34c4b8077f9f10cfa2b54 Mon Sep 17 00:00:00 2001 From: paed01 Date: Sun, 16 Jul 2023 07:17:50 +0200 Subject: [PATCH] describe idleTimeout and broker option --- README.md | 6 +++++- example/README.md | 4 ++++ package.json | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 example/README.md diff --git a/README.md b/README.md index 6e1e90a..469e01c 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ app.use('/rest', bpmnEngineMiddleware()); app.use(errorHandler); +app.listen(3000); + function errorHandler(err, req, res, next) { if (!(err instanceof Error)) return next(); if (err instanceof HttpError) return res.status(err.statusCode).send({ message: err.message }); @@ -27,9 +29,11 @@ function errorHandler(err, req, res, next) { ## Options -- `adapter`: Optional [storage adapter](#storage-adapter). Defaults to in-memory adapter +- `adapter`: Optional [storage adapter](#storage-adapter). Defaults to in-memory adapter based on LRU cache - `engineOptions`: Optional BPMN Engine [options](https://github.com/paed01/bpmn-engine/blob/master/docs/API.md) - `engineCache`: Optional engine LRU cache, defaults to `new LRUCache({ max: 1000 })` +- `broker`: Optional [smqp](https://npmjs.com/package/smqp) broker, used for forwarding events from executing engines +- `idleTimeout`: Optional positive integer, engine execution timeout in milliseconds before engine execution is considered idle and is stopped, defaults to 120000ms # Routes diff --git a/example/README.md b/example/README.md new file mode 100644 index 0000000..5cb890a --- /dev/null +++ b/example/README.md @@ -0,0 +1,4 @@ +Example app +=========== + +Start your Camunda Modeler and hit play. REST endpoint is `http://localhost:3000/rest`. diff --git a/package.json b/package.json index 18083e3..f2309ce 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,11 @@ { "name": "bpmn-middleware", - "version": "0.0.2", + "version": "0.0.3", "description": "BPMN engine express middleware", "type": "module", "main": "dist/main.cjs", "module": "src/index.js", + "types": "index.d.ts", "scripts": { "test": "mocha -R dot", "posttest": "npm run lint && npm run dist && npm run tsd",