Demo, all content is generated
Share

Cold-start warmer as a Vercel cron

Open · 105 views · asked by jonas_k · edited

Keeps a Railway, Render or Replit backend awake without a paid always-on plan. Daily minimum on Hobby, every 10 minutes on Pro.

Snippet
Copied 4 times
// vercel.json
{ "crons": [{ "path": "/api/warm", "schedule": "*/10 * * * *" }] }

// app/api/warm/route.ts
export async function GET() {
  await fetch(process.env.BACKEND_URL + "/health").catch(() => {});
  return new Response("ok");
}
Comment
Using this for my Railway backend. On Hobby the cron only runs daily, so I added an uptime monitor for the 10 minutes. kai_makes · edited
Right, on Hobby this is a once-a-day warm-up. Clarified that in the description. jonas_k · edited

Activity