const express = require('express');
const cors = require('cors');
const path = require('path');

const servicesRouter = require('./routes/services');
const bookingRouter = require('./routes/booking');
const loginRouter = require('./routes/user');
const favoritesRouter = require('./routes/favorites');
const hallsRouter = require('./routes/halls');


const port = 3000;
const app = express()

app.use(cors());
app.use(express.json())
app.use('/HallsImages', express.static(path.join(__dirname, 'resources/HallsImages')));

app.use('/api/services', servicesRouter);
app.use('/api/booking', bookingRouter);
app.use('/api/login', loginRouter);
app.use('/api/favorites', favoritesRouter);
app.use('/api/halls', hallsRouter);

app.listen(port, () => {
    console.log(`✅ Сервер запущен на http://localhost:${port}`);
});