Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
Add test Zoom integration
Browse files Browse the repository at this point in the history
  • Loading branch information
curtgrimes committed Jun 15, 2020
1 parent d797211 commit cb69766
Show file tree
Hide file tree
Showing 14 changed files with 875 additions and 525 deletions.
1 change: 1 addition & 0 deletions app/api/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ routes.use('/charges', require('./charges'));
routes.use('/storage', require('./storage'));
routes.use('/fonts', require('./fonts'));
routes.use('/patreon', require('./patreon'));
routes.use('/zoom', require('./zoom'));

module.exports = routes;
26 changes: 26 additions & 0 deletions app/api/routes/zoom/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const zoom = require('express').Router();
const axios = require('axios');

zoom.post('/api', async (req, res) => {
const { apiPath, transcript } = req.body;
if (!apiPath || !transcript) {
return res.status(400).send('Incomplete request: ' + req.body);
}

axios
.post(apiPath, transcript, {
headers: { 'Content-Type': 'text/plain' },
})
.then((response) => {
// Response
console.log(transcript);
console.log(response.status);
res.sendStatus(200);
})
.catch((e) => {
console.error(e);
res.sendStatus(500);
});
});

module.exports = zoom;
Loading

0 comments on commit cb69766

Please sign in to comment.