2.0.1 • Published 1 month ago

ethereal-wave-limiter v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

ethereal-wave-limiter

Ethereal Wave Limiter is a Node.js library that provides rate limiting functionality for Express applications.

Installation

To install Ethereal Wave Limiter, use npm:

npm install ethereal-wave-limiter

Usage

const express = require('express');
const rateLimit = require('express-rate-limit');
const app = express();

// Apply rate limiter middleware
const limiter = rateLimit({
  windowMs: 60 * 1000, // 1 minute
  max: 100, // limit each IP to 100 requests per windowMs
  message: 'Too many requests, please try again later.'
});
app.use(limiter);

// Your Express routes here
app.get('/', (req, res) => {
  res.send('Hello World!');
});

// Start the server
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
  console.log(`Server is running on port ${PORT}`);
});

Options

The following options are available when configuring the rate limiter:

  • windowMs: The time window for which to keep records (in milliseconds).
  • max: The maximum number of requests allowed in the window.
  • message: The message sent when the limit is exceeded.

License

This project is licensed under the MIT License - see the `LICENSE` file for details.

2.0.1

1 month ago

2.0.0

2 months ago

1.0.0

2 months ago