Express req and res

Tell us what’s happening:
I can’t finish my code because I don’t know why please help me?

Your project link(s)

solution: https://replit.com/@benjiealcontin2/boilerplate-express

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36

Challenge: Start a Working Express Server

Link to the challenge:

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

The callback function doesn’t seems valid syntax to me.

You either use an arrow function:

app.get('/', (req, res) => {
  // your logic
})

Or an actual function

app.get('/', function(req, res) {
  // your logic
})

I suggest you to revisit the syntax if you still have doubts.

Hope this helps.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.