feat(provider): 🔥 add twilii (weoking)

This commit is contained in:
Leifer Mendez
2022-12-05 20:45:05 +01:00
parent 30e3d443bb
commit 4350dff22a
8 changed files with 53 additions and 27 deletions

View File

@@ -0,0 +1,21 @@
const polka = require('polka')
const parsePolka = require('@polka/parse')
class WebHookServer {
incomingMsg = (req, res, next) => {
const { body } = req
let json = JSON.stringify({ error: 'Missing CSRF token', body })
res.end(json)
}
start = () => {
polka()
.use(parsePolka.urlencoded({ extended: false }))
.post('/hook', this.incomingMsg)
.listen(3000, () => {
console.log(`> Running on localhost:3000 /hook`)
})
}
}
module.exports = WebHookServer