Created
May 19, 2009 12:36
-
-
Save jashkenas/114069 to your computer and use it in GitHub Desktop.
This file contains 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
var shttpd = net.http.server.shttpd | |
var Server = shttpd.Server; | |
var httpd = new Server(8080); | |
print ("Starting server on port 8080") | |
httpd.registerURI( | |
"/", | |
function (request) { | |
request.print("HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"); | |
request.print("<html><body>Hello, v8 world</body></html>"); | |
request.setFlags(shttpd.END_OF_OUTPUT); | |
} | |
) | |
while (1) { httpd.processRequests() } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment