Revisions
-
ali revised this gist
Dec 18, 2012 . 1 changed file with 6 additions and 7 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,7 @@ # Learning some Node/Express/Coffeescript :> ### http = require 'http' nouns = [ 'ali', 'pranav', 'wylie', 'spencer', @@ -19,12 +18,12 @@ random = (array) -> index = Math.floor(Math.random()*array.length) array[index] http.createServer((req, res) -> noun = random nouns adjective = random adjectives sentence = noun + ' is ' + adjective res.writeHead 200, {'Content-Type': 'text/plain'} res.end sentence ).listen 3000 console.log 'You should hit up 0.0.0.0:3000' -
There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ ### # Learning some Node/Express/Coffeescript :> ### express = require 'express' app = express() nouns = [ 'ali', 'pranav', 'wylie', 'spencer', 'dnb', 'cba', 'thang', 'DDS', 'leebot' ] adjectives = [ 'smelly', 'awesome', 'in need of a rewrite', 'lazy', 'inefficient', 'radiant' ] random = (array) -> index = Math.floor(Math.random()*array.length) array[index] app.get '/', (req, res) -> noun = random nouns adjective = random adjectives sentence = noun + ' is ' + adjective res.send sentence console.log 'You should hit up 0.0.0.0:3000' app.listen 3000