0.0.4 • Published 4 years ago

simple-webhooks-server v0.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Simple webhooks server

A simple webhooks server to execute command when a url is requested.

Example

import { serve } from 'simple-webhooks-server';

serve({
  port: 4003,
  contextPath: '/example',
  logHooksToConsole: true,
  enableTaskStatusPage: true,
  hooks: [
    // (GET or POST) http://localhost:4003/example/hooks/hello/hello-secret
    {
      name: 'hello',
      secret: 'hello-secret',
      command: 'echo hello',
    },
    // (POST only) http://localhost:4003/example/hooks/sleep/sleep-secret
    {
      name: 'sleep',
      secret: 'sleep-secret',
      command: 'sleep 3 && date',
      postOnly: true
    }
  ]
});