DEV Community

Алексей Спинов
Алексей Спинов

Posted on

Website Uptime Monitoring for Free — Build It in 30 Lines

You don't need Pingdom or UptimeRobot. A simple Node.js script + Apify scheduler = free monitoring.

The Check

async function check(url) {
  const start = Date.now();
  try {
    const res = await fetch(url, { method: "HEAD", signal: AbortSignal.timeout(10000) });
    return { url, isUp: res.status < 400, status: res.status, responseMs: Date.now() - start };
  } catch (e) {
    return { url, isUp: false, error: e.message, responseMs: Date.now() - start };
  }
}
Enter fullscreen mode Exit fullscreen mode

What to Monitor

  • Status code — 200 = up, 4xx/5xx = down
  • Response time — >3 seconds = slow
  • SSL cert — expiring soon?
  • Content — page loads but empty?

Free Scheduling

Apify lets you schedule actor runs on a cron. Set hourly checks for free.

I built an Uptime Checker on Apify — search knotless_cadence uptime.

Top comments (0)