Skip to content

Instantly share code, notes, and snippets.

@jashkenas
Created May 19, 2009 12:36
Show Gist options
  • Save jashkenas/114069 to your computer and use it in GitHub Desktop.
Save jashkenas/114069 to your computer and use it in GitHub Desktop.
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