-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecutor.js
More file actions
33 lines (31 loc) · 712 Bytes
/
executor.js
File metadata and controls
33 lines (31 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const axios = require("axios");
const qs = require('qs');
module.exports = async (data) => {
const datas = qs.stringify({
'code': data.code,
'language':data.language,
'input':data.input
});
console.log(datas)
const options = {
method: "POST",
url: 'https://api.codex.jaagrav.in',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: datas
};
console.log("options")
try {
const response = await axios(options);
console.log("t1")
const output = response.data.output;
console.log(output)
return output
} catch (error) {
return {
status:error.status,
Message:error.message
};
}
};