1.13.10 • Published 6 years ago

@bearer/express v1.13.10

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

@bearer/express

TODO: description

Usage

// your server.ts
import express from 'express'
import bearerWebhooks from '@bearer/express'

const app = express()

// each value must be a function returning a promise
const webhookHandlers = {
  ['integration-name-to_handle']: req =>
    new Promise(() => {
      // you logic goes here
      if (something) resolve()
      else {
        reject()
      }
    }),
  ['with-async-await']: async req => {
    // you logic goes here
    // ex: console.log(req.body)
    const reponse = await somethingYouWantToWaitFor
    if (response.success) {
      return whatever
    } else {
      throw new Error('An error occured')
    }
  }
}
// Without options
app.use('/whaterver_path_you_want/webhhoks', bearerWebhooks(webhookHandlers))

// With options
app.use('/whaterver_path_you_want/webhhoks', bearerWebhooks(webhookHandlers), { token: 'YOU_SECRET_TOKEN' })
2.0.0

6 years ago

1.13.10

6 years ago

1.13.9

6 years ago

1.13.8

6 years ago

1.13.4

6 years ago

1.8.0

6 years ago

1.7.1-canary.2

6 years ago

1.8.0-canary.2

6 years ago

1.7.0

6 years ago

1.6.8

6 years ago

1.6.2-canary-4.1

6 years ago

1.6.1

6 years ago

1.4.2-canary.17

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.115.1

6 years ago

0.115.0

6 years ago