shelf_throttle 0.5.2 copy "shelf_throttle: ^0.5.2" to clipboard
shelf_throttle: ^0.5.2 copied to clipboard

A Shelf middleware that applies throttling to incoming requests.

example/main.dart

import 'package:shelf/shelf.dart';
import 'package:shelf/shelf_io.dart';
import 'package:shelf_throttle/shelf_throttle.dart';

void main() async {
  const message = 'Responding at most once each 5 seconds';
  final handler = throttle(Duration(seconds: 5)).addHandler((request) => Response.ok(message));
  await serve(handler, 'localhost', 8080);
}
1
likes
160
points
26
downloads

Publisher

unverified uploader

Weekly Downloads

A Shelf middleware that applies throttling to incoming requests.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

shelf

More

Packages that depend on shelf_throttle