const Database = require('/var/www/api_placa/node_modules/better-sqlite3');
const path = require('path');
const DB_PATH = '/var/www/api_placa/f7imr6zs30ovzazu/keys.db';

try {
    const db = new Database(DB_PATH, { readonly: true });
    const keys = db.prepare("SELECT key_value FROM api_keys WHERE active = 1 AND expires_at > datetime('now', 'localtime') LIMIT 1").all();
    console.log(JSON.stringify(keys));
    db.close();
} catch (e) {
    console.error(e.message);
}
