Created
May 30, 2017 17:31
-
-
Save fkchang/540d47db9a734acf495c531e39677fa9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nodejs' | |
require 'native' | |
http = Native(node_require('http')) | |
port = 1337 | |
http.createServer(lambda { |req, res| | |
opal_res = Native(res) | |
opal_res.writeHead(200, { 'Content-Type': 'text/plain' }.to_n) | |
opal_res.end("Hello World\n") | |
}).listen(port) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment