Skip to content

Commit d5cee99

Browse files
author
Matheus Vieira
committed
v0.1.1
1 parent 4a906c3 commit d5cee99

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

README.md

16 Bytes

Instructions to use

  1. Add RateLimit class in your project.
  2. Create an instance of the RateLimit class and run the doFilter method around your HTTP endpoint.
    ...
    rateLimit = RateLimit.getInstance();
    rateLimit = new RateLimit();
    ...

    if (rateLimit.doFilter(request)) {
        json = "{\"message\": \"ok\"}";
        response.setStatus(200);			
    } else {
        json = "{\"message\": \"too many requests\"}";
        response.setStatus(429);
    }

For more details, see the example of the MyServlet class.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>mathunes</groupId>
55
<artifactId>rate-limit</artifactId>
6-
<version>0.0.1-SNAPSHOT</version>
6+
<version>0.1.1-SNAPSHOT</version>
77
<packaging>war</packaging>
88

99
<dependencies>

0 commit comments

Comments
 (0)