"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = __importDefault(require("express"));
const cors_1 = __importDefault(require("cors"));
const dotenv_1 = __importDefault(require("dotenv"));
const db_1 = __importDefault(require("./config/db"));
const authRoutes_1 = __importDefault(require("./routes/authRoutes"));
const posRoutes_1 = __importDefault(require("./routes/posRoutes")); // Import POS routes
const paymentRoutes_1 = __importDefault(require("./routes/paymentRoutes")); // Import Payment routes
dotenv_1.default.config();
const app = (0, express_1.default)();
const PORT = process.env.PORT || 5000;
// Connect to Database
(0, db_1.default)();
// Middleware
app.use((0, cors_1.default)());
app.use(express_1.default.json());
// Routes
app.use('/api/auth', authRoutes_1.default);
app.use('/api/pos', posRoutes_1.default); // Mount POS routes
app.use('/api/payment', paymentRoutes_1.default); // Mount Payment routes
// Basic Route
app.get('/', (req, res) => {
    res.send('Dine360 API is running...');
});
// Start Server
app.listen(PORT, () => {
    console.log(`Server is running on port ${PORT}`);
});
