Binato/server/util/AsyncHttpRequest.js

10 lines
252 B
JavaScript
Raw Normal View History

2021-02-13 13:01:40 +00:00
const request = require("request");
module.exports = async function(url) {
return new Promise((resolve, reject) => {
request(url, (err, res, body) => {
if (err) reject(err);
else resolve(body);
});
});
}