Spaces:
Runtime error
Runtime error
Download src/server.ts from akash1313/kodelyx-backend: direct link, hf CLI and curl.
- Browser
- Download file 591 Bytes
-
https://huggingface.co/spaces/akash1313/kodelyx-backend/resolve/main/src/server.ts
- Command line
-
hf download hf://spaces/akash1313/kodelyx-backend/src/server.ts
-
curl -L -o server.ts https://huggingface.co/spaces/akash1313/kodelyx-backend/resolve/main/src/server.ts
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}`); | |
| }); | |