Commit 5ce68d98 authored by Balasuriya D.A.M.'s avatar Balasuriya D.A.M.

Remove End point and Add new end point with User Routes

parent e3eaf05a
const express = require("express");
const router = express.Router();
//router.route("/").post(registerUser)
//router.post("/login",authUser)
module.exports = router;
...@@ -4,6 +4,7 @@ const dotenv = require("dotenv"); ...@@ -4,6 +4,7 @@ const dotenv = require("dotenv");
const { chats } = require("./data/data"); const { chats } = require("./data/data");
const connectDB = require("./config/db"); const connectDB = require("./config/db");
const colors = require("colors"); const colors = require("colors");
const userRoutes = require("./routes/userRoutes");
dotenv.config(); dotenv.config();
...@@ -18,17 +19,7 @@ app.get("/", (req, res) => { ...@@ -18,17 +19,7 @@ app.get("/", (req, res) => {
res.send("API is Running Successfully"); res.send("API is Running Successfully");
}); });
app.get("/api/chat", (req, res) => { app.use("/api/user", userRoutes);
res.send(chats);
});
app.get("/api/chat/:id", (req, res) => {
// console.log(req.params.id);
const singleChat = chats.find((c) => c._id === req.params.id);
res.send(singleChat);
});
const PORT = process.env.PORT || 5000; const PORT = process.env.PORT || 5000;
......
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