const fs = require('fs');
const content = fs.readFileSync('dist/server.cjs', 'utf8');

const targetStr = '/api/mikrotik/';
let idx = 0;
while ((idx = content.indexOf(targetStr, idx)) !== -1) {
  const lineEnd = content.indexOf('\n', idx);
  console.log(content.substring(idx, lineEnd));
  idx += targetStr.length;
}
