Skip to content

Commit

Permalink
error resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
parthgupta21 committed May 19, 2024
1 parent 5694bfc commit f022039
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions backend/routes/message.routes.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import express from "express";
import { sendMessage, getMessage } from "../controllers/message.controller.js";
import { sendMessage, getMessages } from "../controllers/message.controller.js";
import protectRoute from "../middleware/protectRoute.js";

const router = express.Router();

router.get("/:id", protectRoute, getMessage);
router.get("/:id", protectRoute, getMessages);
router.post("/send/:id", protectRoute, sendMessage);

export default router;
7 changes: 1 addition & 6 deletions backend/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ import dotenv from "dotenv";
import cookieParser from "cookie-parser";
import authRoutes from "./routes/auth.routes.js";
import messageRoutes from "./routes/message.routes.js";
import path from "path";
import express from "express";
import dotenv from "dotenv";
import cookieParser from "cookie-parser";

import authRoutes from "./routes/auth.routes.js";
import messageRoutes from "./routes/message.routes.js";

import userRoutes from "./routes/user.routes.js";

import connectToMongoDB from "./db/connectToMongoDB.js";
Expand Down

0 comments on commit f022039

Please sign in to comment.