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 trialKsenia Mikhailovskaya
1,999 PointsTrouble viewing the page
Hello!
I have an issue running app.js in node - the browser looks up 127.0.0.1 in Yahoo instead of showing the html. My code is here:
https://github.com/ksenia0822/Node.js_SimpleDynamicSite_TreeHouse
Many thanks in advance!
2 Answers
Greg Adams
13,268 PointsHi Ksenia-
I was able to get a server started by just listing the port. See here:
var http = require('http');
http.createServer(function (request, response) {
router.home(request, response);
router.user(request, response);
}).listen(3000);
console.log('Server running at http://workspaceurl:3000');
Are you using Node on Workspaces or your local computer? If you are using on Workspaces, 127.0.0.1 won't work as that is a default local address for a local server.
Greg
Thomas Katalenas
11,033 Pointshow do we get it on the web page?
Ksenia Mikhailovskaya
1,999 PointsKsenia Mikhailovskaya
1,999 PointsHi Greg! I am using console, not the workspace and unfortunately it still doesn't work.