summaryrefslogtreecommitdiff
path: root/server/js/apibay.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/js/apibay.js')
-rw-r--r--server/js/apibay.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/server/js/apibay.js b/server/js/apibay.js
new file mode 100644
index 0000000..74fcfb3
--- /dev/null
+++ b/server/js/apibay.js
@@ -0,0 +1,16 @@
+"use strict";
+
+const axios = require('axios');
+const server = 'https://apibay.org';
+
+async function getRequest(url)
+{
+ return await axios.get(url);
+}
+
+async function hit(query)
+{
+ return await getRequest(server + '/q.php?q=' + encodeURI(query));
+}
+
+module.exports = {hit}; \ No newline at end of file