Binato/server/util/AsyncHttpRequest.js
2021-02-13 13:01:40 +00:00

10 lines
No EOL
252 B
JavaScript

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);
});
});
}