Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKevin Ohlsson
4,559 PointsResponse is not defined
Hello I am unable to complete the first segment of the code quiz with this code that should be correct
I have shortened request to "req" and response to "res" as instructed in the previous video https://teamtreehouse.com/library/adding-multiple-routes-to-the-app @55 seconds
what am i doing wrong?
const express = require('express');
const app = express();
app.get('/', (req, res) => { response.send("I Love Treehouse!"); });
app.listen(3000);
const express = require('express');
const app = express();
app.get('/', (req, res) => {
response.send("I Love Treehouse!");
});
app.listen(3000);
1 Answer
Ari Misha
19,323 PointsHello there! You're almost there, Kevin Ohlsson ! You forgot to change the response to res in the local scope of the callback. Here is how your code should look like:
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send("I Love Treehouse!");
});
app.listen(3000);
I hope it helped!
~ Ari
Kevin Ohlsson
4,559 PointsKevin Ohlsson
4,559 PointsThanks Ari!
Back on track now!