kodelyx-backend / src /server.ts
kodelyx's picture
Deploy NestJS backend with Prisma SQLite support
bd9f61b
Raw
History Blame Contribute Delete
591 Bytes
import express from 'express';
import cors from 'cors';
import dotenv from 'dotenv';
import authRoutes from './routes/auth';
dotenv.config();
const app = express();
const PORT = process.env.PORT || 5000;
app.use(cors({
origin: 'http://localhost:5173', // Vite React local dev port
credentials: true
}));
app.use(express.json());
// Routes
app.use('/api/auth', authRoutes);
// Health check
app.get('/health', (req, res) => {
res.json({ status: 'OK', timestamp: new Date() });
});
app.listen(PORT, () => {
console.log(`๐Ÿš€ API Server running on http://localhost:${PORT}`);
});