Skip to content

bytaesu/hono-cf-rate-limit

Repository files navigation

hono-cf-rate-limit

Rate Limiting for Hono on Cloudflare Workers

Intro

The official documentation and examples felt outdated or overly complex, so I’ve created and use this instead.

Note

This repository is featured in the official Cloudflare documentation.
It has been reviewed by the Cloudflare and Hono teams, so you can safely use this.

Usage

This is not published as an npm package. It would feel like a wrapper around a wrapper.
Just copy the code directly into your project if needed.

The API response types used here follow my personal convention.
You are free to modify or remove them to fit your own needs.

Code:

Copy the src/rate-limit.ts file into your project.

TypeScript:

Use Wrangler to generate the type bindings:

wrangler types --env-interface CloudflareBindings

License

Inspired by elithrar/workers-hono-rate-limit

MIT

About

Rate Limiting for Hono on Cloudflare Workers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published