Created
January 4, 2022 07:28
-
-
Save toshvelaga/642a6cca2254db694da314c00de0222c to your computer and use it in GitHub Desktop.
twilio STUN AND TURN SERVER CREDENTIALS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // twilio STUN AND TURN SERVER CREDENTIALS | |
| app.post('/api/twilio', async (req, res) => { | |
| const baseUrl = `https://api.twilio.com/2010-04-01/Accounts/${accountSid}/Tokens.json` | |
| const token = await axios | |
| .post( | |
| baseUrl, | |
| {}, | |
| { | |
| auth: { | |
| username: accountSid, | |
| password: authToken, | |
| }, | |
| } | |
| ) | |
| .then((res) => { | |
| return res.data | |
| }) | |
| .catch((err) => { | |
| return err | |
| }) | |
| console.log(token) | |
| res.json(token) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment