Skip to content

Tolfix/simple-docker-webhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Simple docker webhook

Simple Webhook Github

This package is used to spin up a webserver to get POST requests from docker webhook.

Installing

npm install simple-docker-webhook

Examples - Simple

You can setup a simple webhook like this..

Typescript

import SimpleWebhook from "simple-docker-webhook";

const Port = 3000;
const webhook = new SimpleWebhook(Port);

webhook.on(response => {
    // Do something
})

JavaScript

const SimpleWebhook = require("simple-docker-webhook");

const Port = 3000;
const webhook = new SimpleWebhook.default(Port);

webhook.on(response => {
    // Do something
})

Examples - Express

You can also use express as an middleware

Typescript

import SimpleWebhook from "simple-docker-webhook";
import Express from "express";

const Port = 3000;
const app = Express();
const webhook = new SimpleWebhook(app);

webhook.on(response => {
    // Do something
})

app.listen(Port);

JavaScript

const SimpleWebhook = require("simple-docker-webhook");
const Express = require("express");

const Port = 3000;
const app = Express();
const webhook = new SimpleWebhook.default(app);

webhook.on(response => {
    // Do something
})

app.listen(Port);

Configurations

...
interface Options 
{
    /**
     * @param endpoint The endpoint for the webserver
     * @default /webhook
     */
    endpoint: string;
}
...

⚙ | Tolfix

Tolfix is a company focusing about IT, Development and Networking, we drive to help others with their problems when it comes to IT and love contributing to others. Want to find more information about us you can visit us at https://tolfix.com/.

Releases

No releases published

Sponsor this project

 

Packages

No packages published