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

151
Views
I can't connect to localhost 5000, when I try to load the page, It says that It can't access the site

I specify the port in .env file. In the result I expect to see "{message:'WORKING!'}" on the page, but It just can't open the page There is a code in index.js

require('dotenv').config()
const express = require('express')
const models = require('./models/models')
const cors = require('cors')
const PORT = process.env.PORT || 5000

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

app.get('/', () => {
   res.status(200).json({message:'WORKING!'})
})

const start = async () => {
   try {
      await sequelize.authenticate()
      await sequelize.sync()
      app.listen(PORT, () => console.log('Port ' + PORT))
   } catch (error) {
      console.log(error)
   }
}

start()

And in .env I have written PORT=5000

about 4 years ago · Juan Pablo Isaza
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!