// если указать encoding:null - request вернет body в бинарном формате
request(
{url:'https://www.w3schools.com/css/img_fjords.jpg', encoding:null},
function (err, res, body) {
if(err) {
return console.error('error', err)
}
dbx.filesUpload({ path: '/w3.jpg', contents: body })
.then(resp => {
console.log(resp);
})
.catch(err => {
console.log(err);
});
});
pkill node
const handler1 = require('./handler1');
const handler2 = require('./handler2');
app.get('/first', handler1.get.bind(handler1, {myParam: "Hello"}));
app.get('/second', handler2.get.bind(handler2, {myParam: "World"}));
exports.get = function(share, req, res, next) {
console.log(share.myParam);
}