Firewall

Apiker can interact with the Cloudflare Firewall to prevent endpoint flooding.

To enable it, set the firewall option to true or pass an object such as the following:

firewall: { limitRequestsPerMinute: 100 }

The firewall option requires that you specify a Cloudflare Token with Firewall permissions in the .env. Please follow the guide on how to create API tokens.

Example (in your .env file):

CLOUDFLARE_WAF_KEY = "XXXXX"

Notes:

  • You can use the Firewall Banning and Unbanning handlers in your application at will. Just import the Firewall methods that are exported from the apiker package.