mirror of
				https://codeberg.org/ashley/poke
				synced 2025-07-17 16:52:11 +00:00 
			
		
		
		
	add ratelimits :3
This commit is contained in:
		
							parent
							
								
									5dfeb84bb1
								
							
						
					
					
						commit
						6c15fc8b5f
					
				| @ -61,9 +61,16 @@ | ||||
|   ); | ||||
| 
 | ||||
|   const sha384 = modules.hash; | ||||
|   const rateLimit = require("express-rate-limit"); | ||||
| 
 | ||||
| 
 | ||||
|    const limiter = rateLimit({ | ||||
|      windowMs: 30 * 1000, // 30 Seconds
 | ||||
|      max: 870, // limit each IP to 870 requests per windowMs
 | ||||
|    }); | ||||
|     | ||||
|   var app = modules.express(); | ||||
|   app.use(limiter); | ||||
|   initlog("Loaded express.js"); | ||||
|   app.engine("html", require("ejs").renderFile); | ||||
|   app.use(modules.express.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Ashley
						Ashley