[mirotalksfu] - update dep.

This commit is contained in:
Miroslav Pejic
2023-07-26 14:58:27 +02:00
parent 5b2713472a
commit 9c0de3db45
3 changed files with 25 additions and 22 deletions
+1 -1
View File
@@ -55,7 +55,7 @@
- Direct `peer-to-peer` connection ensures the lowest latency thanks to `WebRTC`
- Supports [REST API](app/api/README.md) (Application Programming Interface)
- [Slack](https://api.slack.com/apps/) API integration
- [Sentry](https://sentry.io/) error reporting
- [Sentry](https://sentry.io/) for error reporting
- ...
</details>
+21 -18
View File
@@ -1,22 +1,25 @@
const fetch = require('node-fetch');
async function getMeeting() {
try {
// Use dynamic import with await
const { default: fetch } = await import('node-fetch');
const API_KEY = 'mirotalk_default_secret';
// const MIROTALK_URL = 'http://localhost:3000/api/v1/meeting';
const MIROTALK_URL = 'https://p2p.mirotalk.com/api/v1/meeting';
// const MIROTALK_URL = 'https://mirotalk.up.railway.app/api/v1/meeting';
const API_KEY = 'mirotalk_default_secret';
// $MIROTALK_URL = "http://localhost:3000/api/v1/meeting";
MIROTALK_URL = 'https://p2p.mirotalk.com/api/v1/meeting';
// $MIROTALK_URL = "https://mirotalk.up.railway.app/api/v1/meeting";
function getResponse() {
return fetch(MIROTALK_URL, {
method: 'POST',
headers: {
authorization: API_KEY,
'Content-Type': 'application/json',
},
});
const response = await fetch(MIROTALK_URL, {
method: 'POST',
headers: {
authorization: API_KEY,
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log('meeting:', data.meeting);
} catch (error) {
console.error('Error fetching data:', error);
}
}
getResponse().then(async (res) => {
console.log('Status code:', res.status);
const data = await res.json();
console.log('meeting:', data.meeting);
});
getMeeting();
+3 -3
View File
@@ -33,8 +33,8 @@
"license": "AGPL-3.0",
"homepage": "https://github.com/miroslavpejic85/mirotalk",
"dependencies": {
"@sentry/integrations": "^7.58.1",
"@sentry/node": "^7.58.1",
"@sentry/integrations": "^7.60.0",
"@sentry/node": "^7.60.0",
"axios": "^1.4.0",
"body-parser": "^1.20.2",
"colors": "^1.4.0",
@@ -53,7 +53,7 @@
"yamljs": "^0.3.0"
},
"devDependencies": {
"node-fetch": "^2.6.6",
"node-fetch": "^3.3.2",
"prettier": "3.0.0"
}
}