@ruleenginejs/express
v1.0.6
Published
Rule engine express middleware
Downloads
11
Maintainers
Readme
@ruleenginejs/express
Installation
npm install @ruleenginejs/express
Usage
const express = require("express");
const ruleEngine = require("@ruleenginejs/express");
const app = express();
app.use("/rules/:id", ruleEngine({
"rule": require("./pipeline")
}))
app.listen(8080);
Documentation
Custom id param
app.use("/rules/:ruleId", ruleEngine(rules, {
idParam: "ruleId"
})
Enable debug
app.use("/rules/:id", ruleEngine(rules, {
debug: app.get("env") === "development"
})
License
Licensed under the MIT License.