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 trial

JavaScript Express Basics Getting Started with Express Setting Up a Basic Express App

Riley Starnes
Riley Starnes
1,020 Points

I'm getting "Bummer: Cannot read property 'toString' of undefined".

I changed request and response to req and res, and also adjusting the response.send to res.send. I keep getting some error about toString, I don't think the error is on my end.

app.js
const express = require('express');

const app = express();

app.get('/', (req, res) => {
  res.send('I Love Treehouse!');
});

app.listen(3000);

1 Answer

Adam Beer
Adam Beer
11,314 Points

I think it was a bug. Please refresh your page and try again. Your code is good!

Riley Starnes
Riley Starnes
1,020 Points

Awesome, thank you! Worked fine after refreshing this time :)