0

Hi Basir,

not able to resolve error 404 while signing in signinscreen.js

import express from 'express';
// import data from './data.js';
import mongoose from 'mongoose';
import dotenv from 'dotenv';
import seedRouter from './routes/seedRoutes.js';
import productRouter from './routes/productRoutes.js';
import userRouter from './routes/userRoutes.js';
 dotenv.config();
mongoose.set("strictQuery", true);
mongoose
  .connect(process.env.MONGODB_URI)
  .then(() => {
    console.log('connected to Db')
  }).catch(err => {
    console.log(err.message);
  });
const app = express();
 app.use(express.json());
app.use(express.urlencoded({ extended: true }));
 app.use('/api/seed', seedRouter);
app.use('/api/products', productRouter);
app.use('/api/users', userRouter);
 app.use((err, req, res, next) => {
  res.status(500).send({ message: err.message })
})
const port = process.env.PORT || 5000;
app.listen(port, () => {
  console.log(`serve at http://localhost:${port}`);
});

[/apcode]

manju Asked question December 26, 2022