Add DEBUG_MODE env var for some smol things

This commit is contained in:
Christopher Cookman 2025-10-04 23:20:07 -06:00
parent ba9013d9a9
commit 11592d8bd1

View file

@ -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) {