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 trialAlejandro Fidanza
Full Stack JavaScript Techdegree Graduate 24,840 PointsCan I create the server in my computer with nodeJS(S.O LINUX)?, I need use nodeJS and NGINX?..thank you.
I was reading and found this research:
http://stackoverflow.com/questions/5009324/node-js-nginx-what-now
I want to know if I can run the server in my computer without workspaces, or maybe the security of linux is the problem, but I am trying to do it without going far away from the courses!
1 Answer
Brodey Newman
10,962 PointsYou can set up a Node development environment using the code below taken from MDN.
This is a great way to stay along with the coursework without using workspaces.
//Load HTTP module
var http = require("http");
//Create HTTP server and listen on port 8000 for requests
http.createServer(function (request, response) {
// Set the response HTTP header with HTTP status and Content type
response.writeHead(200, {'Content-Type': 'text/plain'});
// Send the response body "Hello World"
response.end('Hello World\n');
}).listen(8000);
// Print URL for accessing server
console.log('Server running at http://127.0.0.1:8000/')