Keep your free tier backends alive, responsive, and observable!
Ping-Me is a full-stack open-source infrastructure utility that prevents automatic sleep cycles on free hosting platforms like Render, Railway, Cyclic, Glitch, and Vercel Functions.
Free-tier backend hosts are amazing β until they're not:
- π Your server goes to sleep after minutes of inactivity
- π’ First requests are cold, taking seconds to start
- π¬ It times out if you don't keep it warm
- π§ͺ When demoing or testing, your APIs break unpredictably
Ping-Me makes sure your backend never sleeps, and if it tries, you know about it:
- π Keep-alive Pinging: Automatically pings your endpoint on intervals
- βοΈ Framework Adapters: Plug into Express, Fastify, Koa, Next.js, Hono
- π§ͺ Dashboard UI: View uptime %, ping latency, error codes, logs
- π API Key Access: Each user gets a unique key to isolate metrics
- π‘οΈ Abuse Protection: Rate limiting, IP filtering, data-size capping
- π§© CLI Tool: Bootstrap your server with pings instantly
# Install the core library
npm install @ping-me/core
# Or use the framework-specific adapter
npm install @ping-me/express
# npm install @ping-me/next
# npm install @ping-me/fastify
# npm install @ping-me/koa
# npm install @ping-me/honoOr use the CLI to set up:
npx ping-me init
npx ping-me add expressconst express = require('express');
const { withPingMe } = require('@ping-me/express');
const app = express();
// Add ping-me to your app
withPingMe(app, {
route: '/ping-me', // Custom route (default: /ping-me)
interval: 300000, // 5 minutes
baseUrl: 'https://my-api.com', // Optional: specify exact URL
apiKey: 'your-api-key' // Optional: for dashboard metrics
});
app.listen(3000);// pages/api/ping-me.js
import { createPingMeHandler } from '@ping-me/next';
export default createPingMeHandler();
// In your _app.js or a component
import { usePingMe } from '@ping-me/next';
function MyApp({ Component, pageProps }) {
// This will auto-ping your endpoint
const status = usePingMe({
interval: 300000, // 5 minutes
apiKey: process.env.PING_ME_API_KEY // Optional
});
return <Component {...pageProps} />;
}import { pingMe } from '@ping-me/core';
// Start pinging
const stopPinging = pingMe({
url: 'https://my-api.com/ping',
interval: 300000, // 5 minutes
apiKey: 'your-api-key', // Optional
log: console.log // Optional custom logger
});
// Stop pinging later if needed
stopPinging();A beautiful Next.js dashboard is available to monitor your backend services:
- π Uptime Charts: See your uptime over time
- β±οΈ Response Times: Track latency trends
- π¬ Status Logs: View ping history and errors
- π Alert Settings: Configure notification preferences
Track your metrics with the Ping-Me API:
# Ping Logging Endpoint
POST https://ping-me-api.vercel.app/api/log
Authorization: Bearer your-api-key
{
"endpoint": "https://my-api.com",
"status": 200,
"responseTime": 123
}
# Get Metrics
GET https://ping-me-api.vercel.app/api/metrics
Authorization: Bearer your-api-keyThis is a monorepo built with Turborepo and PNPM:
ping-me/
βββ apps/
β βββ dashboard/ β Next.js 14 + Tailwind CSS dashboard
β βββ examples/ β Example usage of ping-me
β βββ api/ β Serverless API routes
βββ packages/
β βββ core/ β Framework-agnostic ping logic
β βββ cli/ β CLI: npx ping-me init
β βββ express/ β Express adapter
β βββ fastify/ β Fastify adapter
β βββ next/ β Next.js adapter
β βββ koa/ β Koa adapter
β βββ hono/ β Hono adapter
β βββ metrics-server/ β Metrics Server
We welcome contributions! See CONTRIBUTING.md for details.
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Install dependencies:
pnpm install - Make your changes
- Run tests:
pnpm test - Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you find Ping-Me useful, please consider sponsoring the project:
Made with β€οΈ by @mreshank