我正在制作一个允许我在我的 express api(nodejs)中将图片上传到 imgur 的函数,在调用返回承诺的函数时遇到错误:
类型错误:res.status 不是 uploadpicture.then 的函数
这是我的代码: 引发错误的地方:
router.post('/upload', (req, res, next)=> {
var busboy = new Busboy({headers: req.headers});
busboy.on('file', function(fieldname, file, filename, encoding, mimetype) {
if(fieldname == 'image') {
// the buffer
file.fileRead = [];
file.on('data', function(data) {
// add to the buffer as data comes in
this.fileRead.push(data);
});
file.on('end', function() {
// create a new stream with our buffered data
var finalBuffer = Buffer.concat(this.fileRead);
upload = uploadpicture(finalBuffer).then((res)=>{ //success request
console.log(res);
res.status(200).json({success: true, message: "Successfully uploaded …Run Code Online (Sandbox Code Playgroud) 我需要在我的应用程序中实现视频通话,然后我发现了 webrtc,以及 nodejs 的 simple-peer。我只有一个问题,因为它是点对点的,我想用户不是匿名的,他们可以互相获取他们的 ip。
我知道 facebook、amazon chime 使用 webrtc,他们如何隐藏这些 ip?他们是否通过服务器传递流?使用转服务器?openvidu 会隐藏 ip 吗?或者我可以简单地为每个视频室在 nodejs 进程中创建对等点,并连接到每个用户并分发视频?
谢谢