Refactor logging levels in transform.ts and adjust JSON body parser configuration in app.ts
This commit is contained in:
@@ -15,6 +15,11 @@ import { modelsRoutes } from './routes/models'
|
||||
const logger = loggerService.withContext('ApiServer')
|
||||
|
||||
const app = express()
|
||||
app.use(
|
||||
express.json({
|
||||
limit: '50mb'
|
||||
})
|
||||
)
|
||||
|
||||
// Global middleware
|
||||
app.use((req, res, next) => {
|
||||
@@ -111,7 +116,6 @@ app.get('/', (_req, res) => {
|
||||
// Provider-specific API routes with auth (must be before /v1 to avoid conflicts)
|
||||
const providerRouter = express.Router({ mergeParams: true })
|
||||
providerRouter.use(authMiddleware)
|
||||
providerRouter.use(express.json())
|
||||
// Mount provider-specific messages route
|
||||
providerRouter.use('/v1/messages', messagesProviderRoutes)
|
||||
app.use('/:provider', providerRouter)
|
||||
@@ -119,7 +123,6 @@ app.use('/:provider', providerRouter)
|
||||
// API v1 routes with auth
|
||||
const apiRouter = express.Router()
|
||||
apiRouter.use(authMiddleware)
|
||||
apiRouter.use(express.json())
|
||||
// Mount routes
|
||||
apiRouter.use('/chat', chatRoutes)
|
||||
apiRouter.use('/mcps', mcpRoutes)
|
||||
|
||||
@@ -7,7 +7,7 @@ const logger = loggerService.withContext('ApiServerUtils')
|
||||
|
||||
// Cache configuration
|
||||
const PROVIDERS_CACHE_KEY = 'api-server:providers'
|
||||
const PROVIDERS_CACHE_TTL = 5 * 60 * 1000 // 5 minutes
|
||||
const PROVIDERS_CACHE_TTL = 1 * 60 * 1000 // 1 minutes
|
||||
|
||||
export async function getAvailableProviders(): Promise<Provider[]> {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user