acadable / labs/lazyserve
    SHIPPING · v1.0.3 ON NPM

    Wake your local server on demand.
    Sleep when nobody's around.

    LazyServe sits between ngrok and your local server. Your public URL stays alive on a tiny placeholder; your real app spins up only when a request actually arrives, then shuts down after idle. No more laptop fans roaring while you're at lunch.

    install
    $ npm i -g lazyserve
    v1.0.3
    shipping on npm
    ~2-5s
    cold start
    ~0%
    idle CPU
    MIT
    license
    // HOW IT WORKS

    Two processes. One cheap. One on-demand.

    A tiny placeholder proxy holds the port that ngrok points at. Your real server only runs when there's actual traffic - and stops as soon as the room goes quiet.

    request flow
    Internet → ngrok
    public URL
    always alive
    LAZYSERVE
    :4000placeholder
    intercepts requests · wakes server · forwards · sleeps after idle
    Your server
    :3000
    starts/stops
    1
    Always-on placeholder

    Tiny Fastify proxy holds the port. Near-zero CPU.

    2
    ngrok stays connected

    Public URL never goes down. No tunnel restart.

    3
    Request arrives

    Sleeping server gets spawned via child_process.

    4
    Health-check ready

    Proxy waits for your --health-path to return 200.

    5
    Idle → kill

    N minutes with no traffic and the server is shut down.

    // CAPABILITIES

    Built for the ngrok-on-laptop life.

    If you've ever closed your laptop with a tunnel still running, only to find your battery at 3% and your demo URL dead, this is for you.

    Sleeps when idle

    After your configured idle window (default 15 minutes), the real server is killed. No CPU, no fan noise, no battery drain.

    Wakes on real traffic

    First request triggers a spawn. The cold start is ~2-5 seconds depending on your stack - every subsequent request is instant.

    Public URL stays alive

    Because the placeholder always holds the port, ngrok never disconnects. Webhooks, demos, and shared links don't break.

    Stack-agnostic

    Wraps any command. Node, Python, Go, Rails, Deno - if it boots and listens on a port, LazyServe can sleep it.

    // INSTALL & USE

    One install, one wrap.

    LazyServe is a CLI you wrap your dev command with. There's also a programmatic API if you'd rather drive it from a script.

    # 1. Install globally
    npm i -g lazyserve
    
    # 2. Wrap your dev command
    lazyserve "npm start" --port 3000
    
    # Done. Your ngrok URL is up; your server only runs on demand.
    // FLAGS

    Every option, one table.

    FLAG
    DEFAULT
    DESCRIPTION
    --port
    3000
    Port your real server runs on.
    --proxy-port
    port + 1000
    Port for the always-on placeholder proxy.
    --idle
    15
    Minutes of inactivity before sleeping the server.
    --authtoken
    env
    ngrok auth token. NGROK_AUTHTOKEN env var also works.
    --domain
    -
    Custom ngrok domain (paid plans).
    --region
    auto
    ngrok region: us, eu, ap, au, sa, jp, in.
    --health-path
    /
    Path to health-check your server's readiness before forwarding.
    --silent
    false
    Suppress LazyServe's own logs.
    // PORT LAYOUT By default your real server runs on :3000 and the placeholder on :4000 - ngrok points at the placeholder. Override either with --port or --proxy-port.
    // COMPARE

    Why not just leave ngrok running?

    You can. But your dev server keeps spinning, your laptop keeps heating, and your battery keeps dying. LazyServe keeps the URL up while letting the actual app rest.

    CAPABILITY
    RAW LOCALHOST
    NGROK ALONE
    LAZYSERVE
    Public URL while you're away
    Server sleeps when idle
    Auto-wake on real request
    No reconnect / URL changes
    Works with any language
    Zero idle CPU & battery
    // FAQ

    Common questions.

    // GET IT

    Stop heating your laptop for nothing.

    One npm install, one wrapped command. LazyServe is MIT-licensed and shipping today.

    MIT-licensedWorks with any languageBuilt in Indore