mirror of https://github.com/aiden09/mirotalksfu
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
700 B
JavaScript
30 lines
700 B
JavaScript
'use strict';
|
|
|
|
const fetch = require('node-fetch');
|
|
|
|
const API_KEY = 'mirotalksfu_default_secret';
|
|
const MIROTALK_URL = 'http://localhost:3010/api/v1/join';
|
|
|
|
function getResponse() {
|
|
return fetch(MIROTALK_URL, {
|
|
method: 'POST',
|
|
headers: {
|
|
authorization: API_KEY,
|
|
'Content-Type': 'application/json',
|
|
},
|
|
body: JSON.stringify({
|
|
room: 'test',
|
|
name: 'mirotalksfu',
|
|
audio: true,
|
|
video: true,
|
|
notify: true,
|
|
}),
|
|
});
|
|
}
|
|
|
|
getResponse().then(async (res) => {
|
|
console.log('Status code:', res.status);
|
|
const data = await res.json();
|
|
console.log('join:', data.join);
|
|
});
|