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 trialDaniel Benisti
Front End Web Development Techdegree Graduate 22,224 PointsThe server running on the console but not in the preview
Hi, my node server is running through the terminal. but when I try to preview I get an error.
const http = require('http');
const hostname = '127.0.0.1'; const port = 3000;
const server = http.createServer((request, response) => { response.statusCode = 200; response.setHeader('Content-Type', 'text/plain'); response.end('Hello World!\n'); });
server.listen(port, () => {
console.log(Server running at http://<workspace-url>/
);
});
I've also tried to copy-paste the exact code from node docs. Thank you
Daniel Benisti
Front End Web Development Techdegree Graduate 22,224 PointsThe problem has been fixed. Thanks.
1 Answer
Kortney Field
14,091 PointsI am having the same issues. How did you fix it?
KRIS NIKOLAISEN
54,972 PointsKRIS NIKOLAISEN
54,972 PointsWhat error did you receive?