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

175
Views
parse function is deprecated in url Module when i Parse a Url module

when I coding a server application in node js, I need to parse a URL . so I imported the URL module and used the parse function. but it doesn't work. it shows parse was deprecated. how to fix it? answers, please...

enter image description here enter image description here

 var http=require('http')
var fs = require('fs')
var url=require('url')

http.createServer(function (req,res){
    var q=url.parse(req.url)
    console.log(q.pathname)

    if(req.url==='/'){
fs.readFile('sample.html',function (err,data){
   res.writeHead(200,{'Content-Type':'text/html'})
    res.write(data)
    res.end()
})

}else if(req.url==='/signup'){
    fs.readFile('signup.html',(err,data)=>{
        res.writeHead(200,{'Content-Type':'text/html'})
        res.write(data)
        res.end() 
    })
   
    
}
else if (req.url==='/signupaction'){
    res.write('sucessfully signup')
    res.end()
}

else{
    res.writeHead(404,{'Content-Type':'text/html'})
    res.write('error')
    res.end()
}

}).listen(7000,()=>
    console.log("server started now")
)

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!