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