Skip to content

Commit 0d559d7

Browse files
committed
Update example
1 parent 30b16be commit 0d559d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/basic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def __init__(self) -> None:
2828
# Add the ratelimiter middleware to the application
2929
# This allows global and per-route rate limiting
3030
# You can use this with Redis or in-memory storage
31-
ratelimiter = Middleware(starlette_plus.middleware.RatelimitMiddleware)
31+
# Set ignore_localhost to False if you want to rate limit localhost requests (Set to False for Testing)
32+
ratelimiter = Middleware(starlette_plus.middleware.RatelimitMiddleware, ignore_localhost=False)
3233

3334
# We set a prefix which means all routes will be prefixed with /v1
3435
super().__init__(prefix="/v1", middleware=[ratelimiter], access_log=True)

0 commit comments

Comments
 (0)