AbsoluteJS

absolutejs-rate-limit-example

absolutejs-rate-limit-examplev0.0.1betaDev Tools

Single-package example for @absolutejs/rate-limit. Boots an Elysia app with three rate-limiting setups:

#Installation

BASH
# Private workspace project: ~/abs/examples/rate-limit

#Capabilities

Overview

Single-package example for @absolutejs/rate-limit. Boots an Elysia app with three rate-limiting setups:

Global per-IP gate — GCRA, 10 requests/second sustained with burst 5.

Per-route cost — /api/upload charges 5× what /api/info charges.

Show 3 more

Stacked per-user gate — combined runs a per-user token bucket on

top of a shared global one.

The React page surfaces the IETF RateLimit- headers in a decision log so you can watch the bucket drain and the breaker trip in real time.

Run

Then http://localhost:3000/.

Test

Playwright drives the page through a burst that's guaranteed to throttle, and confirms the IETF headers + Retry-After are emitted correctly.

Outcomes

What you can build

Build on the supported package contract

Use absolutejs-rate-limit-example through its supported public entry points.

Hardening checklist

Production guidance

Make every external boundary explicitPin the deployed absolutejs-rate-limit-example version, replace example or memory-backed dependencies with durable implementations, bound external calls, protect credentials, and emit enough evidence to retry or recover safely.

Follow in order

Troubleshooting path

1
Trace from the first failed boundary
Reproduce the smallest canonical absolutejs-rate-limit-example example, confirm the supported entry point and version in the API explorer, then inspect the first boundary that did not produce its documented result.

#Run

Partial snippet

Working example for Run.

BASH
bun install
bun run dev      # absolute dev — hot reload
# or
bun run start    # absolute start — production server

#Test

Partial snippet

Working example for Test.

BASH
PORT=3000 bun run test

#Package commands

Scripts declared by this package manifest.

bun run devabsolute dev
bun run formatabsolute prettier --write
bun run lintabsolute eslint
bun run startabsolute start
bun run testplaywright test
bun run typecheckabsolute typecheck
Private workspace project
This project is maintained inside the workspace and is not published as a standalone npm package.