why login user data is mixed with product data

Viewed 22

I'm making a mern login + crud application

this is an example, the data in numbers 1 and 2 are examples of product data, and numbers 3 and 4 are registered user data

why is this getting mixed up, is there an error in routes?

this is my source code from index.js

require("dotenv").config();
const express = require("express");
const app = express();
const cors = require("cors");
const Database = require("./config/db");

// database connection

Database();

// middlewares
app.use(express.json());
app.use(cors());

// routes

app.use("/api/userku/users", require('./routes/users'))
app.use("/api/userku/auth", require('./routes/auth'))
app.use("/api/databengkel", require('./routes/DataRoute'))

const port = process.env.PORT || 5000;

app.listen(port, console.log(`Listening on port ${port}...`));
0 Answers
Related