[mirotalksfu] - update dep, API snippets
هذا الالتزام موجود في:
@@ -1,23 +1,30 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const fetch = require('node-fetch');
|
async function getMeeting() {
|
||||||
|
try {
|
||||||
|
// Use dynamic import with await
|
||||||
|
const { default: fetch } = await import('node-fetch');
|
||||||
|
|
||||||
const API_KEY = 'mirotalksfu_default_secret';
|
const API_KEY = 'mirotalksfu_default_secret';
|
||||||
const MIROTALK_URL = 'https://sfu.mirotalk.com/api/v1/meeting';
|
const MIROTALK_URL = 'https://sfu.mirotalk.com/api/v1/meeting';
|
||||||
// const MIROTALK_URL = 'http://localhost:3010/api/v1/join';
|
// const MIROTALK_URL = 'http://localhost:3010/api/v1/meeting';
|
||||||
|
|
||||||
function getResponse() {
|
const response = await fetch(MIROTALK_URL, {
|
||||||
return fetch(MIROTALK_URL, {
|
method: 'POST',
|
||||||
method: 'POST',
|
headers: {
|
||||||
headers: {
|
authorization: API_KEY,
|
||||||
authorization: API_KEY,
|
'Content-Type': 'application/json',
|
||||||
'Content-Type': 'application/json',
|
},
|
||||||
},
|
});
|
||||||
});
|
const data = await response.json();
|
||||||
|
if (data.error) {
|
||||||
|
console.log('Error:', data.error);
|
||||||
|
} else {
|
||||||
|
console.log('meeting:', data.meeting);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching data:', error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getResponse().then(async (res) => {
|
getMeeting();
|
||||||
console.log('Status code:', res.status);
|
|
||||||
const data = await res.json();
|
|
||||||
console.log('meeting:', data.meeting);
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
$API_KEY = "mirotalksfu_default_secret";
|
$API_KEY = "mirotalksfu_default_secret";
|
||||||
$MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/meeting";
|
$MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/meeting";
|
||||||
// $MIROTALK_URL = "http://localhost:3010/api/v1/join";
|
// $MIROTALK_URL = "http://localhost:3010/api/v1/meeting";
|
||||||
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL, $MIROTALK_URL);
|
curl_setopt($ch, CURLOPT_URL, $MIROTALK_URL);
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
# pip3 install requests
|
# pip3 install requests
|
||||||
# pip3 install requests
|
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
|
|
||||||
API_KEY = "mirotalksfu_default_secret"
|
API_KEY = "mirotalksfu_default_secret"
|
||||||
MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/meeting"
|
MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/meeting"
|
||||||
# MIROTALK_URL = "http://localhost:3010/api/v1/join"
|
# MIROTALK_URL = "http://localhost:3010/api/v1/meeting"
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
"authorization": API_KEY,
|
"authorization": API_KEY,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
API_KEY="mirotalksfu_default_secret"
|
API_KEY="mirotalksfu_default_secret"
|
||||||
MIROTALK_URL="https://sfu.mirotalk.com/api/v1/meeting"
|
MIROTALK_URL="https://sfu.mirotalk.com/api/v1/meeting"
|
||||||
# MIROTALK_URL="http://localhost:3010/api/v1/join"
|
# MIROTALK_URL="http://localhost:3010/api/v1/meeting"
|
||||||
|
|
||||||
curl $MIROTALK_URL \
|
curl $MIROTALK_URL \
|
||||||
--header "authorization: $API_KEY" \
|
--header "authorization: $API_KEY" \
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
"yamljs": "0.3.0"
|
"yamljs": "0.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"node-fetch": "^2.6.7",
|
"node-fetch": "^3.3.2",
|
||||||
"prettier": "3.0.0"
|
"prettier": "3.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم