From 6cb0efc1abeccd8f6a9c7ca7f209ff22c42341bd Mon Sep 17 00:00:00 2001 From: kaotisk Date: Fri, 1 Mar 2024 02:47:10 +0200 Subject: Renamed functions and routes receive* -> announce* szbk -> /v0/announce/zblock szch -> /v0/announce/zchain --- api/routes/receiveZBlock/index.js | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 api/routes/receiveZBlock/index.js (limited to 'api/routes/receiveZBlock/index.js') diff --git a/api/routes/receiveZBlock/index.js b/api/routes/receiveZBlock/index.js deleted file mode 100644 index 4f1ae3d..0000000 --- a/api/routes/receiveZBlock/index.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Accepts a ZBLOCK! - * - * Checks: - * 1. Exists, - * 2. Length is 46 bytes, - * 3. Matches regular expression /Qm[A-Za-z0-9]{44}/ - * - * Returns: - * - error on failure - * - on success the string is processed for further - * validation to the function getvalidity() - * - */ -const getvalidity = require('../../validators/ZblockValidator') -module.exports = (req, res) => { - console.log("okay we got called") - if ( (req.body.zblock) && req.body.zblock.length === 46 ){ - regex= /Qm[A-Za-z0-9]{44}/; - if (regex.test(req.body.zblock)){ - getvalidity(req.body.zblock,res); - } else { - res.send({error:"Invalid data"}); - } - } else { - res.send({error:"Invalid data"}); - } -} -- cgit v1.2.3