sec fixes

This commit is contained in:
Andrey Kondratev
2025-08-29 10:21:18 +05:00
parent 8895639f20
commit 3fb0d43221
7 changed files with 36 additions and 16 deletions

View File

@@ -23,7 +23,7 @@ export class Database {
const connectionString = process.env.DATABASE_URL || 'postgresql://quixotic:quixotic123@localhost:5432/quixotic';
this.pool = new Pool({
connectionString,
ssl: process.env.NODE_ENV === 'production' ? { rejectUnauthorized: false } : false
ssl: process.env.DATABASE_SSL === 'true' ? { rejectUnauthorized: false } : false
});
this.init();
}

View File

@@ -1,4 +1,5 @@
import express, { Request, Response } from 'express';
import express, { Request, Response } from 'express';
import path from 'path';
import fs from 'fs';
import ffmpeg from 'fluent-ffmpeg';
@@ -198,7 +199,7 @@ app.get('/health', (req: Request, res: Response) => {
});
// Error handler
app.use((err: Error, req: Request, res: Response) => {
app.use((err: Error, req: Request, res: Response, next: any) => {
console.error(err.stack);
res.status(500).json({ error: 'Something went wrong!' });
});