const express = require("express");
const bodyParser = require("body-parser");
const apiRoutes = require("./routes/api.routes");
const frontRoutes = require("./routes/front.routes");

const app = express();
const PORT = process.env.PORT || 3000;

// Middleware
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

// Routes
app.use("/api", apiRoutes);
app.use("/", frontRoutes);

// Start the server
app.listen(PORT, () => {
  console.log(`Server is running on http://localhost:${PORT}`);
});
