Skip to content

Latest commit

 

History

History

nodejs-express-rl

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
Arcjet Logo

Arcjet Rate Limit with Express for Node.js

This example shows how to use Arcjet with a Node.js Express 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/nodejs-express-rl
    npm ci
  3. Rename .env.local.example to .env.local and add your Arcjet key.

  4. Start the server.

    npm start

    This assumes you're using Node.js 20 or later because the start script loads a local environment file with --env-file. If you're using an older version of Node.js, you can use a package like dotenv to load the environment file.

  5. Visit http://localhost:3000/.

  6. Refresh the page to trigger the rate limit.