2.1.0 • Published 5 years ago

@ryanburnette/rebuild-endpoint v2.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
5 years ago

rebuild-endpoint

repo npm

Express.js endpoint for initiating a rebuild of static assets.

Options

  • cmd The rebuild command.
  • execOpts The opts passed to child_process.exec. Take a look at the source for the defaults. Passed options are merged in.
  • execCb The child_process.exec callback. https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback
  • timeout Time to wait between receiving a webhook and starting the rebuild. Gets reset if another webhook is received while waiting. Defaults to one minute (1000 * 60).
  • filter A test that must pass for a rebuild to be triggered. This should be a function. Truthy returns trigger a rebuild.

Filters

This endpoint is expected to be the recipient of a webhook for services like Github. Check filters/ for useful examples.

Usage

var express = require('express');
var rebuildEndpoint = require('@ryanburnette/rebuild-endpoint');

var app = express();

app.post(
  '/rebuild',
  express.json(),
  rebuildEndpoint({
    cmd: 'scripts/build-production'
  })
);
2.1.0

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago