Skip to content

Instantly share code, notes, and snippets.

@EkaanshArora
Created December 21, 2021 14:55
Show Gist options
  • Save EkaanshArora/08ea30f0b741b8064e5c80eccc7c145e to your computer and use it in GitHub Desktop.
Save EkaanshArora/08ea30f0b741b8064e5c80eccc7c145e to your computer and use it in GitHub Desktop.
node token blog - 10
...
let uid = req.params.uid;
if(!uid || uid === '') {
return resp.status(500).json({ 'error': 'uid is required' });
}
// get role
let role;
if (req.params.role === 'publisher') {
role = RtcRole.PUBLISHER;
} else if (req.params.role === 'audience') {
role = RtcRole.SUBSCRIBER
} else {
return resp.status(500).json({ 'error': 'role is incorrect' });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment