building works!
diff --git a/pages/api/rsmv/complete.js b/pages/api/rsmv/complete.js
index 3259967..97f02b7 100644
--- a/pages/api/rsmv/complete.js
+++ b/pages/api/rsmv/complete.js
@@ -1,6 +1,6 @@
import Axios from 'axios';
-export default async (req, res) => {
+const Complete = async (req, res) => {
let code = await Axios.post('http://localhost:3000/api/rsmv/validate', {code:req.body.code});
if (code.status != 200) {
return res.send(404);
@@ -15,3 +15,5 @@
)
return res.send(resp.status);
}
+
+export default Complete;
\ No newline at end of file
diff --git a/pages/api/rsmv/validate.js b/pages/api/rsmv/validate.js
index 7359a68..4aade75 100644
--- a/pages/api/rsmv/validate.js
+++ b/pages/api/rsmv/validate.js
@@ -5,7 +5,7 @@
const db = 'rsm';
const collection = 'rsmv-tokens'
-export default (req, res) => {
+const Validate = (req, res) => {
return new Promise((resolve, reject) => {
MongoClient.connect(url, async function(err, client) {
let db_response = await client.db(db).collection(collection).findOne({code: req.body.code});
@@ -25,4 +25,6 @@
return resolve(res.status(200).send(props));
})
})
-}
\ No newline at end of file
+}
+
+export default Validate;
\ No newline at end of file
diff --git a/pages/api/rsmv/verifyTkn.js b/pages/api/rsmv/verifyTkn.js
index 7e9d06f..50eb77e 100644
--- a/pages/api/rsmv/verifyTkn.js
+++ b/pages/api/rsmv/verifyTkn.js
@@ -1,7 +1,7 @@
import Axios from 'axios';
import qs from 'querystring';
-export default async (req, res) => {
+const verifyTkn = async (req, res) => {
const chk = await Axios.post('https://hcaptcha.com/siteverify', qs.stringify({
response: req.body.tkn,
secret: '0x19C699BFfce07b2a026121DE6702706BB2d51D6c',
@@ -9,4 +9,6 @@
}))
return res.send({ success: chk.data.success });
-}
\ No newline at end of file
+}
+
+export default verifyTkn;
\ No newline at end of file