Skip to content

Commit

Permalink
set req limit before adding middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
j4ys0n committed Sep 25, 2024
1 parent 8adf483 commit 6d232a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "llm-proxy",
"version": "1.4.2",
"version": "1.4.3",
"description": "Manages Nginx for reverse proxy to multiple LLMs, with TLS & Bearer Auth tokens",
"main": "dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ const port = process.env.PORT || 8080
const targetUrls = (process.env.TARGET_URLS || 'http://example.com').split(',').map((url) => url.trim())

// app.use(express.json())
app.use(bodyParser.json())
const payloadLimit = process.env.PAYLOAD_LIMIT || '1mb'
app.use(bodyParser.json({ limit: payloadLimit }))
app.use(bodyParser.urlencoded({ extended: false, limit: payloadLimit }))
app.use(bodyParser.json())
log('info', `Payload limit is: ${payloadLimit}`)

// Express routes
Expand Down

0 comments on commit 6d232a8

Please sign in to comment.