Skip to content

Instantly share code, notes, and snippets.

@tim-smart
Created February 28, 2010 08:44
Show Gist options
  • Select an option

  • Save tim-smart/317493 to your computer and use it in GitHub Desktop.

Select an option

Save tim-smart/317493 to your computer and use it in GitHub Desktop.
http: require 'http'
body: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"' +
' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' +
'<html>' +
' <head>' +
' <meta http-equiv="Content-type" content="text/html; charset=utf-8" />' +
' <title>Page Title</title>' +
' </head>' +
' <body>' +
' </body>' +
' <script type="text/javascript" charset="utf-8">' +
' document.addEventListener("DOMContentLoaded", function(ev) {' +
' ev.stopPropagation();' +
' }, false);' +
' </script>' +
'</html>'
server: http.createServer (request, response) ->
request.addListener 'end', ->
response.writeHeader 200, {
'content-type': 'text/html'
'content-length': body.length
}
response.write body
response.close()
server.listen 8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment