This is the vscode editor page where i am getting error . I am not able to conclude why? please anyone tell where i am going wrong. I am deploying a website which consists of reactJs and nodeJs and MongoDB
VS Code editor Error
this is my index.js file
const express = require("express");
const app = express();
const mongoose = require("mongoose");
const dotenv = require("dotenv");
const userRoute = require("./routes/user");
const authRoute = require("./routes/auth");
const productRoute = require("./routes/product");
const cartRoute = require("./routes/cart");
const orderRoute = require("./routes/order");
const stripeRoute = require("./routes/stripe");
mongoose.connect("MONGO_URL").then(()=>console.log("DB Connection Sucessful")).catch((err)=>{
console.log(err);
});
dotenv.config();
mongoose
.connect(process.env.MONGO_URL)
.then(() => console.log("DB Connection Successfull!"))
.catch((err) => {
console.log(err);
});
app.use(express.json());
app.use("/api/auth",authRoute);
app.use("/api/user",userRoute);
app.use("/api/products",productRoute);
app.use("/api/carts", cartRoute);
app.use("/api/orders", orderRoute);
app.use("/api/checkout", stripeRoute);
app.use(express.static(path.join(__dirname, "/frontend/build")));
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, '/frontend/build', 'index.html'));
});
app.listen(process.env.PORT || 5000, ()=>{
console.log("Backend server is running!");
});