diff --git a/backend/controllers/coolieController.js b/backend/controllers/coolieController.js index db5cb45..4193e8a 100644 --- a/backend/controllers/coolieController.js +++ b/backend/controllers/coolieController.js @@ -1,6 +1,9 @@ import { io } from "../index.js"; import CoolieBooking from "../models/CoolieBooking.js"; + + + export const createCoolieBooking = async (req, res) => { try { const { diff --git a/backend/index.js b/backend/index.js index e1cc55b..3ecc689 100644 --- a/backend/index.js +++ b/backend/index.js @@ -5,6 +5,8 @@ import cookieParser from "cookie-parser"; import { createServer } from "http"; import { Server } from "socket.io"; + + const app = express(); const server = createServer(app); @@ -26,9 +28,11 @@ app.use(express.urlencoded({ extended: true })); connectDB(); import authRoutes from "./routes/authRoutes.js"; +import stationRoutes from "./routes/stationRoutes.js"; app.use("/auth", authRoutes); app.use("/api", authRoutes); +app.use("/station", stationRoutes); app.get("/", (req, res) => { res.send("Working..."); @@ -45,7 +49,7 @@ const io = new Server(server, { }); if (process.env.NODE_ENV !== 'production') { - const io = new Server(server, { /* CORS settings */ }); + io.on("connection", (socket) => { console.log("A user connected:", socket.id); socket.on("disconnect", () => { diff --git a/frontend/index.html b/frontend/index.html index cbf26d2..9e3fe55 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -5,8 +5,7 @@