diff --git a/package.json b/package.json index 7216529..63509aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "llm-proxy", - "version": "1.4.1", + "version": "1.4.2", "description": "Manages Nginx for reverse proxy to multiple LLMs, with TLS & Bearer Auth tokens", "main": "dist/index.js", "scripts": { diff --git a/src/index.ts b/src/index.ts index b98ac91..076488e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,7 @@ import { LLMController } from './controllers/llm' import { tokenMiddleware } from './utils/auth' import { AuthController } from './controllers/auth' import { log } from './utils/general' +import bodyParser from 'body-parser' dotenv.config() @@ -12,11 +13,11 @@ const app = express() 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(express.json()) +app.use(bodyParser.json()) const payloadLimit = process.env.PAYLOAD_LIMIT || '1mb' -app.use(express.json({ limit: payloadLimit })) -app.use(express.urlencoded({ limit: payloadLimit, extended: true })) +app.use(bodyParser.json({ limit: payloadLimit })) +app.use(bodyParser.urlencoded({ extended: false, limit: payloadLimit })) log('info', `Payload limit is: ${payloadLimit}`) // Express routes