This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LRUCache } from 'lru-cache'; | |
const rateLimit = (options) => { | |
const tokenCache = new LRUCache({ | |
max: options?.uniqueTokenPerInterval || 500, | |
ttl: options?.interval || 60000, | |
}) | |
return { | |
check: (res, limit, token) => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
server_name localhost; | |
# Load configuration files for the default server block. | |
include /etc/nginx/default.d/*.conf; | |
location / { | |
proxy_pass http://localhost:3000; |
OlderNewer