File size: 677 Bytes
e6b5231
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const express = require('express');
const cors = require('cors');
const dotenv = require('dotenv');
const path = require('path');
const negotiateRoutes = require('./routes/negotiate');

dotenv.config();
const app = express();
const PORT = process.env.PORT || 3008;

app.use(cors());
app.use(express.json());
app.use('/api/negotiate', negotiateRoutes);
app.get('/api/health', (req, res) => res.json({ status: 'ok', service: 'negotiation-sim' }));
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(`Negotiation Simulator running on port ${PORT}`));