Skip to content

Commit

Permalink
param for request timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
gandlafbtc committed Feb 18, 2023
1 parent 4f60d4c commit ee54eaa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PORT=3000
MINT_URL='https://legend.lnbits.com/cashu/api/v1/4gr9Xcmz3XEkUNwiBiQGoC'
FAUCET_INTERVAL=5000
SATS_PER_INTERVAL=1
FAUCET_INTERVAL=10000
SATS_PER_INTERVAL=1
REQUEST_TIMEOUT_INTERVAL=15000
REQUEST_TIMEOUT_MAX=5
4 changes: 2 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const port = process.env.PORT
let faucet

const limiter = rateLimit({
windowMs: 15 * 1000, // 15 seconds
max: 5, // Limit each IP to 100 requests per `window` (here, per 15 minutes)
windowMs: process.env.REQUEST_TIMEOUT_INTERVAL, // 15 seconds
max: process.env.REQUEST_TIMEOUT_MAX, // Limit each IP to 100 requests per `window` (here, per 15 minutes)
standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers
legacyHeaders: false, // Disable the `X-RateLimit-*` headers
})
Expand Down

0 comments on commit ee54eaa

Please sign in to comment.