Skip to content

Instantly share code, notes, and snippets.

View dileephell's full-sized avatar
🎯
Focusing

Dileep Singh dileephell

🎯
Focusing
View GitHub Profile
var http = require('http');
http.createServer(function (req, res) {
// set up some routes
switch(req.url) {
case '/':
// show the user a simple form
console.log("[200] " + req.method + " to " + req.url);
res.writeHead(200, "OK", {'Content-Type': 'text/html'});
res.write('<html><head><title>Hello Noder!</title></head><body>');
var http = require('http');
http.createServer(function (req, res) {
// set up some routes
switch(req.url) {
case '/':
// show the user a simple form
console.log("[200] " + req.method + " to " + req.url);
res.writeHead(200, "OK", {'Content-Type': 'text/html'});
res.write('<html><head><title>Hello Noder!</title></head><body>');
var express = require('express')
, crypto = require('crypto');
var app = module.exports = express();
app.use(express.bodyParser());
app.use(express.cookieParser('shhhh, very secret'));
app.use(express.session());
app.set('view engine', 'ejs');
var sys = require('sys'),
http = require('http');
http.createServer(function (req, res) {
switch (req.url) {
case '/':
res.writeHead(200, {'Content-type': 'text/html'});
res.end(
'<form action="/myaction" method="post" enctype="multipart/form-data">'+
'<input type="text" name="field1">' +
var http = require('http'),
sys = require('sys'),
fs = require('fs'),
ws = require('./ws.js');
var clients = [];
http.createServer(function(request, response)
{