Skip to content

Instantly share code, notes, and snippets.

@toshvelaga
Created January 4, 2022 07:28
Show Gist options
  • Select an option

  • Save toshvelaga/642a6cca2254db694da314c00de0222c to your computer and use it in GitHub Desktop.

Select an option

Save toshvelaga/642a6cca2254db694da314c00de0222c to your computer and use it in GitHub Desktop.
twilio STUN AND TURN SERVER CREDENTIALS
// 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