Skip to content
/ smee Public

Persistent local webhooks with no configuration needed.

Notifications You must be signed in to change notification settings

tcr/smee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smee, persistent local webhooks

Create a webhook locally which persists between script runs, with no configuration required.

var smee = require('smee');
smee.persistentHook(function (err, hook) {
  console.log('Your webhook URL:', hook.url); // this URL is the same each time the script is run
  hook.on('callback', function (json) {
    console.log('Received webhook:', json);
  });
});

Hook configuration is stored in a local .smeeconf file in your script directory and is different between scripts.

To use as middleware in a permanent server, just move to smee.hook:

var app = express();
app.use('/webhook/', smee.hook(function (json) {
  console.log('Received webhook:', json);
})

Options

If your webhook call is being sent incorrectly from the server (as form or text data), set json: true in the options:

smee.persistentHook({json: true}, function (err, hook) { ... })

The default port is 9009. If this is conflicting, change it by setting port: ... in the options.

Installation

Install localtunnel:

pip install localtunnel

Then:

npm install smee

License & Credits

Smee is MIT licensed.

And if you're feeling good today, donate to localtunnel for being such an awesome project.

About

Persistent local webhooks with no configuration needed.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published