Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

drover-express-router

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drover-express-router

Express router plugin for Drover control interface

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

node npm npm Travis (.org) Coverage Status

Drover express router plugin

Simple drover plugin for express that provides convenient drover control flow via HTTP

Installation

Using npm:

$ npm i --save drover-express-router

Using yarn:

$ yarn add drover-express-router

Usage

const { MasterFactory } = require('drover');

const app = require('express')();
const drover = require('drover-express-router');

const demo = MasterFactory.create({
  script: 'path/to/demo.js',
});

// one line to plug-in drover controls into your express app
app.use('/demo', drover({ master: demo }));

app.listen(3000);

API

Get status

curl -XGET localhost:3000/demo/status
//{"status": STATUS}

Get workers statuses

curl -XGET localhost:3000/demo/status/workers
//{"workers": [STATUS]}

Scale

curl -XPUT localhost:3000/demo/scale -d 'size=4'

Graceful shutdown

curl -XPUT localhost:3000/demo/shutdown

Start

curl -XPUT localhost:3000/demo/start

Graceful reload

curl -XPUT localhost:3000/demo/reload

Composite apps

If you got composite drover application with 2 or more masters you still can do this like this:

const { MasterFactory } = require('drover');

const app = require('express')();
const drover = require('drover-express-router');

const foo = MasterFactory.create({ script: 'path/to/foo.js' });
const bar = MasterFactory.create({ script: 'path/to/bar.js' });

app.use('/foo', drover({ master: foo }));
app.use('/bar', drover({ master: bar }));

app.listen(3000);

Keywords

FAQs

Package last updated on 15 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc