jashkenas--coffeescript/examples/web_server.coffee

13 lines
264 B
CoffeeScript
Raw Normal View History

2010-02-15 04:20:53 +00:00
# Contributed by Jason Huggins
2010-07-29 04:17:48 +00:00
http = require 'http'
2010-02-15 04:20:53 +00:00
2010-07-29 04:17:48 +00:00
server = http.createServer (req, res) ->
res.writeHeader 200, 'Content-Type': 'text/plain'
res.write 'Hello, World!'
res.end()
2010-02-15 04:20:53 +00:00
server.listen 3000
console.log "Server running at http://localhost:3000/"