simple-webhooks-server
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

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
    }
  ]
});

Readme

Keywords

Package Sidebar

Install

npm i simple-webhooks-server

Weekly Downloads

1

Version

0.0.4

License

MIT

Unpacked Size

16.6 kB

Total Files

6

Last publish

Collaborators

  • john-yuan