Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
Express server is not connected Kindly help me

I am learning mern stack and was watching a tutorial on youtube code camp.org. I followed along with tutor code but his code is working and mines not working. my express server is not connected or something. I started nodemon server.js

[nodemon] 2.0.19 [nodemon] to restart at any time, enter rs [nodemon] watching path(s): . [nodemon] watching extensions: js,mjs,json [nodemon] starting node server.js [nodemon] clean exit - waiting for changes before restart

but i am not getting the console message which i should get if i am connected to express server.

this is my index.js file

import app from '../server'
import mongodb from "mongodb";
import dotenv from "dotenv";
dotenv.config();

const MongoClient = mongodb.MongoClient;

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

MongoClient.connect(process.env.RESTREVIEWS_DB_URI, {
  poolSize: 50,
  wtimeout: 2500,
  useNewUrlParse: true,
}).catch(err => {
  console.error(err.stack)
  process.exit(1)
})
.then(async client => {
    app.listen(port, ()=>{
        console.log(`listening on  ${port}`)
    })
})

and in case you need this is my server.js file

import express from "express"
import cors from "cors"
import restaurants from "./api/restaurants.route.js"

const app = express()

app.use(cors())
app.use(express.json())

app.use("/api/v1/restaurants",restaurants)
app.use("*", (req,res)=>res.status(404).json({error: "not found"}))


export default app

my specified port is 5000

kindly i am a beginner guide me what should i do

thank you!

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!