Skip to content

Instantly share code, notes, and snippets.

@giginet
Created December 24, 2011 22:35
Show Gist options
  • Select an option

  • Save giginet/1518481 to your computer and use it in GitHub Desktop.

Select an option

Save giginet/1518481 to your computer and use it in GitHub Desktop.
http = require('http')
class Server
constructor : (port) ->
http.createServer (req, res) ->
res.writeHead 200, {'Content-Type', 'text/plain'}
res.end "Hello, World!"
.listen port
console.log "Server is running at localhost:#{port}."
new Server(12345)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment