Skip to content

Instantly share code, notes, and snippets.

View jayco's full-sized avatar
🏠
Working from home

Jason Jacob jayco

🏠
Working from home
View GitHub Profile
@jayco
jayco / consolelog
Created October 28, 2012 10:18
log to console
/* 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/');
@jayco
jayco / create server function
Created October 28, 2012 10:01
create new server instance
/* 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(
@jayco
jayco / new server module
Created October 28, 2012 09:58
assign new server module in node js
// Hello world example in nodejs
//writen by jayco
// Create server variable and assign it the node http module
var http_server = require('http');