-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwebhook.js
29 lines (26 loc) · 1.04 KB
/
webhook.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/******************************************************************************
* Dependencies
******************************************************************************/
import 'dotenv/config'
import express from 'express'
/******************************************************************************
* Express config
******************************************************************************/
const app = express()
const port = 8000
app.use(express.json())
/******************************************************************************
* Routes
******************************************************************************/
// Webhook endpoint to handle incoming transcripts from Recall
app.post('/meeting_transcript', (req, res) => {
let { data: { transcript: { speaker, words } } } = req.body
if (speaker !== null) {
const msg = words.map(word => word.text)
console.info(`${speaker}: ${msg.join(' ')}`)
}
res.status(200).send('OK')
})
app.listen(port, () =>
console.log(`webhook running on port ${port}`)
)