Spaces:
Sleeping
Sleeping
| const express = require('express'); | |
| const cors = require('cors'); | |
| const dotenv = require('dotenv'); | |
| const path = require('path'); | |
| const settleRoutes = require('./routes/settle'); | |
| dotenv.config(); | |
| const app = express(); | |
| const PORT = process.env.PORT || 3006; | |
| app.use(cors()); | |
| app.use(express.json()); | |
| app.use('/api/settle', settleRoutes); | |
| app.get('/api/health', (req, res) => { | |
| res.json({ status: 'ok', service: 'argument-settler' }); | |
| }); | |
| app.use(express.static(path.join(__dirname, 'public'))); | |
| app.get('*', (req, res) => { | |
| res.sendFile(path.join(__dirname, 'public', 'index.html')); | |
| }); | |
| app.listen(PORT, () => { | |
| console.log(`Argument Settler API running on port ${PORT}`); | |
| }); | |