This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* log to the console: | |
This allows us to log the output to the console for development purposes, | |
no different to how it is done in browser oriented javascript | |
*/ | |
console.log('server running at http://127.0.0.1:8124/'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Create the new server: | |
Create server and pass it an anonymous function as the argument. | |
The reason for this is that the function will be | |
called whenever there is a new request to the webserver. The function is | |
directly attached to the new webservers (http_server) event listener for | |
the request event that is passed. | |
*/ | |
http_server.createServer( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hello world example in nodejs | |
//writen by jayco | |
// Create server variable and assign it the node http module | |
var http_server = require('http'); |
NewerOlder