From a2c44499c2bc7803329a6630b93f5afdfd8e4d45 Mon Sep 17 00:00:00 2001 From: alma Date: Tue, 15 Apr 2025 11:54:30 +0200 Subject: [PATCH] news widget design 11 --- app/api/news/route.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/api/news/route.ts b/app/api/news/route.ts index bf523fd..0dd42cd 100644 --- a/app/api/news/route.ts +++ b/app/api/news/route.ts @@ -7,6 +7,7 @@ const pool = new Pool({ port: 5432, database: 'rivacube', user: 'alma', + password: 'rivacube', connectionTimeoutMillis: 5000, query_timeout: 5000 }); @@ -88,15 +89,15 @@ export async function GET() { console.log('Connected to PostgreSQL database'); const result = await client.query( - 'SELECT * FROM news ORDER BY date DESC LIMIT 5' + 'SELECT * FROM news ORDER BY date DESC LIMIT 3' ); const formattedNews = result.rows.map(article => { const { displayDate, timestamp } = formatDateTime(article.date); return { id: article.id, - title: truncateText(article.title, 70), - description: truncateText(article.description, 100), + title: truncateText(article.title, 55), + description: truncateText(article.description, 85), displayDate, timestamp, source: formatSource(article.source),