diff --git a/routes/api.js b/routes/api.js index 27f1451..220b1d3 100644 --- a/routes/api.js +++ b/routes/api.js @@ -18,7 +18,15 @@ const fileUtils = require('../fileUtils'); * 500: * description: Internal server error */ -router.get('/projects', projectController.getAllProjects); +router.get('/projects', async (req, res) => { + try { + const projects = await db.query('SELECT * FROM public.projects'); + res.json(projects.rows); + } catch (error) { + console.error('Error fetching projects:', error); + res.status(500).json({ error: 'Internal server error' }); + } +}); /** * @swagger