From 52af9a780831c46c2a6c2ecc1e41e1237d13263c Mon Sep 17 00:00:00 2001 From: Leopoldadmin Date: Mon, 22 Jun 2026 00:06:13 +0000 Subject: [PATCH] feat: update backend src/index.ts with basic Fastify server --- backend/src/index.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index 14c9aa6..c200841 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -1,15 +1,19 @@ -import app from './server.js'; +import fastify from 'fastify' -const PORT = process.env.PORT ? parseInt(process.env.PORT, 10) : 3001; +const app = fastify({ logger: true }) + +app.get('/api/health', async (request, reply) => { + return { status: 'OK' } +}) const start = async () => { try { - await app.listen({ port: PORT, host: '0.0.0.0' }); - console.log(`Server listening on port ${PORT}`); + await app.listen({ port: 3001, host: '0.0.0.0' }) + console.log('Server listening on port 3001') } catch (err) { - app.log.error(err); - process.exit(1); + app.log.error(err) + process.exit(1) } -}; +} -start(); \ No newline at end of file +start() \ No newline at end of file