diff --git a/index.js b/index.js index 0557233..962cfa0 100644 --- a/index.js +++ b/index.js @@ -899,6 +899,11 @@ const genCall = (req, res, apiKey, ani, number) => { pool.getConnection().then(conn => { //conn.query("SELECT * FROM routes WHERE apiKey = ? AND block_start <= ? AND block_start + block_length >= ?", [apiKey, ani, ani]).then((rows) => { conn.query("SELECT * FROM routes WHERE apiKey = ?", [apiKey]).then((rows) => { // We'll try this Nick, if it doesn't work we'll go back to the original + if (process.env.DEBUG_MODE === "true") { + console.log(`API Key: ${apiKey}, ANI: ${ani}, Number: ${number}`); + console.log(`Found ${rows.length} routes for API Key`); + console.log(JSON.stringify(rows)); + } const row = rows[0]; // If no row or error, return 401 if (!row) {