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

283
Views
When i use express and use ''use'' request to get response this came in my chorme bowser Cannot GET

iam new in node.js .iam faceing this problem .When i use express and use ''use'' request to get response to the chorome but this erro came in my chorme bowser Cannot GET. or my app.js file or index.js is in one same folder . folder name is static. Iam not good in english please help me. Or if i use nodemon togther than when i get to localhost the the loaclhost cannot and show this 'This site can’t be reached' i dont know how to fix it can any help me to fix this problem this the code

const express = require("express");
const app = express();
 const port = 8080;

app.use('/static',express.static('express/static'));

app.get("/", (req, res)=>{
    res.status(200).send("This is the first page of node express");
});

app.get("/about", (req, res)=>{
    res.send("This is the about page of node express");

});

app.post("/postabout", (req, res)=>{
    res.send("This is the postabout page of node express");

});

app.post("/erro", (req, res)=>{
    res.status(404).send("This page has been errored in code of 404");

});

app.listen(80,'127.0.0.1', () =>{
    console.log(`The application started and the port is ${port}`);
});
This the image of my code and chrome

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

In app.listen you passed wrong port means you intialized port as 8080 but passed 80

app.listen(8080,() =>{
    console.log(`The application started and the port is ${port}`);
});
about 4 years ago · Juan Pablo Isaza Report

0

Basically, app.use function uses a middleware when a particular API is called it does not a get request.

So try app.get instead of app.use it will work.

app.get('/static', (req, res) => {
  // Do your stuffs.
  return res.send(response)
})
about 4 years ago · Juan Pablo Isaza Report
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!