Commit 69bb53fe authored by Balasuriya D.A.M.'s avatar Balasuriya D.A.M.

Message Routes Create in backend

parent ad39db26
const express = require("express");
const { protect } = require("../middleware/authMiddleware");
const router = express.Router();
//router.route("/").post(protect, sendMessage);
//router.route("/:chatId").get(protect, allMessages);
module.exports = router;
...@@ -5,6 +5,7 @@ const connectDB = require("./config/db"); ...@@ -5,6 +5,7 @@ const connectDB = require("./config/db");
const colors = require("colors"); const colors = require("colors");
const userRoutes = require("./routes/userRoutes"); const userRoutes = require("./routes/userRoutes");
const chatRoutes = require("./routes/chatRoutes"); const chatRoutes = require("./routes/chatRoutes");
const messageRoutes = require("./routes/messageRoutes");
const { notFound,errorHandler} = require("./middleware/errorMiddleware"); const { notFound,errorHandler} = require("./middleware/errorMiddleware");
...@@ -23,6 +24,8 @@ app.get("/", (req, res) => { ...@@ -23,6 +24,8 @@ app.get("/", (req, res) => {
app.use("/api/user", userRoutes); app.use("/api/user", userRoutes);
app.use("/api/chat", chatRoutes); app.use("/api/chat", chatRoutes);
app.use("/api/message", messageRoutes);
//API Error Handling //API Error Handling
app.use(notFound); app.use(notFound);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment