Skip to content

Instantly share code, notes, and snippets.

@fkchang
Created May 30, 2017 17:30
Show Gist options
  • Save fkchang/beef9e3462d27e66d174feb18bf40e4c to your computer and use it in GitHub Desktop.
Save fkchang/beef9e3462d27e66d174feb18bf40e4c to your computer and use it in GitHub Desktop.
require 'nodejs'
http = node_require('http')
port = 1337
http.JS.createServer(lambda { |req, res|
res.JS.writeHead(200, { 'Content-Type': 'text/plain' }.to_n)
res.JS.end("Hello World\n")
}).JS.listen(port)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment