Skip to content

Instantly share code, notes, and snippets.

@denzuko
Forked from hugs/LICENSE
Created May 10, 2011 22:52
Show Gist options
  • Select an option

  • Save denzuko/965547 to your computer and use it in GitHub Desktop.

Select an option

Save denzuko/965547 to your computer and use it in GitHub Desktop.
The Node.js "Hello World" web server ported to CoffeeScript
I, Jason Huggins, the author of the work "CoffeeScript Web Server" (2010), irrevocably renounce
all current and future legal rights to the work in any medium whatsoever.
I stand behind the merit of the work, but disclaim all liability for it under law.
I encourage you, the audience, to share, copy, distribute, perform, remix, mash up, interpret,
excerpt, translate, and otherwise enjoy and use the work as you will.
I request that you acknowledge my authorship.
Digital versions of the work may be available at https://gist.github.com/gists/304374. Learn more
at pleasepirate.org.
# Install Node and CoffeeScript:
# Node : http://github.com/ry/node
# CoffeeScript : http://github.com/jashkenas/coffee-script
#
# In a terminal window:
# $ cd coffee-script
# $ ./bin/node_coffee -r web_server.coffee
#
# Tested with Mac OS X 10.5.8, Node 0.1.26, CoffeeScript 0.5.0
#
# Jeremy Ashkenas has included this script in CoffeeScript's examples directory:
# http://github.com/jashkenas/coffee-script/blob/master/examples/web_server.coffee
http: require "http"
http.createServer( (req, res) ->
res.sendHeader 200, {"Content-Type": "text/plain"}
res.sendBody "Hello, World!"
res.finish()
).listen 8000
puts "Server running at http://127.0.0.1:8000/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment