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

842
Views
Why am I getting ReferenceError: Response is not defined?

I am using node.js with express. I am trying to set up a basic server, but have no idea why I am getting a response error.

var http = require('http');

var myServer = http.createServer(function(req,res){
    response.writeHead(200, {"Content-Type" : "text/plain"});
    response.write('Hello World');
    response.end();
});

myServer.listen(3000);
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

function(req,res)

is supposed to be

function(req, response) {

You don't have a variable named response in the scope of the callback. That is the reason for the reference error

over 4 years ago · Santiago Trujillo 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!