Skip to content

Latest commit

 

History

History

bun-rl

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Arcjet Logo

Arcjet Rate Limit with Bun.sh

This example shows how to use Arcjet with a Bun.sh server.

How to use

  1. From the root of the project, install the SDK dependencies.

    npm ci
  2. Enter this directory and install the example's dependencies.

    cd examples/bun-rl
    bun install
  3. Rename .env.local.example to .env.local and add your Arcjet key.

  4. Start the server.

    bun run --hot index.ts
  5. Visit http://localhost:3000/. Note: If you load this in a browser, you will see 2 requests - one for the page and one for a favicon.

  6. Refresh the page to trigger the rate limit.