const fs = require('fs');

const frontendContent = fs.readFileSync('./dist/assets/index-D9sWWWv_.js', 'utf8');
const backendContent = fs.readFileSync('./dist/server.cjs', 'utf8');

function findMatches(content, filename) {
  let idx = 0;
  console.log(`=== Matches in ${filename} ===`);
  while (true) {
    idx = content.indexOf("/api/mikrotik", idx);
    if (idx === -1) break;
    console.log(content.substring(idx - 100, idx + 200));
    console.log('------------------');
    idx += "/api/mikrotik".length;
  }
}

findMatches(frontendContent, 'frontend bundle');
findMatches(backendContent, 'dist/server.cjs');
