Skip to content

Instantly share code, notes, and snippets.

@dustinmyers
Forked from jaketrent/client.html
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustinmyers/b2c13b80e10d7cb2d06f to your computer and use it in GitHub Desktop.
Save dustinmyers/b2c13b80e10d7cb2d06f to your computer and use it in GitHub Desktop.
<html>
<head>
<script src="http://code.jquery.com/jquery.js"></script>
<script>
$(function() {
$.get('http://localhost:3000')
});
</script>
</head>
</html>
var onRequest = function(req, res) {
res.writeHead(200, {
'Connection': 'close',
'Content-Type': 'text/html'
});
res.end('<h1>Hello world</h1>');
}
http = require('http');
http.createServer(onRequest).listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment