Start a Working Express Server - res.send is not a function

Start a Working Express Server - res.send is not a function
0

#1

Hi, everyone,
I get the error message below whenever I submit the glitch URL or click the show live button:

res.send is not a function

The code I entered is as follows:

app.get('/', function(res, req) {
  res.send('Hello Express');
});

Please, how do I solve this issue?
Find below the link to the challenge:
https://learn.freecodecamp.org/apis-and-microservices/basic-node-and-express/start-a-working-express-server
Thanks.


#2

Change res with req - first is request handler, second response.

Here is official doc from express.js website:

var express = require('express')
var app = express()

// respond with "hello world" when a GET request is made to the homepage
app.get('/', function (req, res) {
  res.send('hello world')
})

#3

Thank you @wawraf. I guess I did not pay attention to details there.