connect-dipswitch

1.0.0 • Public • Published

connect-dipswitch

Connect/Express middleware for Dipswitch.

NPM

Build Status

Installation (via npm)

$ npm install connect-dipswitch --save

Usage

var express = require('express'),
  dipswitchMiddleware = require('connect-dipswitch'),
  app = express();
 
app.use(dipswitchMiddleware({
  redis: require('redis').createClient(),
 
  getTenantId: function (req) {
    // default implementation
    return req.user.tenantId;
  },
 
  getUserId: function (req) {
    // default implementation
    return req.user.id;
  },
 
  getUserGroups: function (req) {
    // default implementation
    return req.user.groups;
  }
}));
 
app.get('/', function (req, res, next) {
  if (!req.dipswitch.EXAMPLE_FEATURE) {
    return next();
  }
  res.send('Hello World');
});
 
app.listen(3000);

License

MIT License

Author

Lanetix (engineering@lanetix.com)

Package Sidebar

Install

npm i connect-dipswitch

Weekly Downloads

4

Version

1.0.0

License

none

Last publish

Collaborators

  • jasif-wm
  • shyam.mohan
  • qbibrahim
  • sidharth.n
  • hariqb
  • arjuncprasannan
  • renjith_ram_qburst
  • anasqburst
  • jyothis-qb
  • qburst-pratyush
  • cdrohithmqb
  • sudheeshqburst
  • davoodul
  • mable-liza-mathew
  • sowmyab
  • anoop-kuttikkattu
  • munisa
  • dheerajds
  • arjunqb
  • ashishqburst
  • lanetix-system
  • manu-kodiyan-winmore
  • dnm-winmore
  • mkdyanugk
  • vigneshk7
  • soumyaarun
  • aswanth
  • sajith.qb
  • dhiluraj-qburst
  • anandqb
  • arun-dtk
  • vikasqb
  • acpradosh1234