Skip to content

Instantly share code, notes, and snippets.

Created December 18, 2012 03:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4324737 to your computer and use it in GitHub Desktop.
Save anonymous/4324737 to your computer and use it in GitHub Desktop.
###
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment