Skip to content

Instantly share code, notes, and snippets.

@aroman
Last active August 29, 2015 14:03
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 aroman/889169f43a38657e2543 to your computer and use it in GitHub Desktop.
Save aroman/889169f43a38657e2543 to your computer and use it in GitHub Desktop.
Jason's Little Kony
<html>
<head>
<title>My Little Kony</title>
</head>
<body>
<div id="kony"></div>
<script>
$.get("/digits", function (err, res) { // I don't actually remember the args
$("#kony").html("Kony " + JSON.parse(res).currently);
});
</script>
</body>
</html>
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.render("index.html");
});
app.get('/digits', function (req, res) {
res.json({currently: 2012});
});
app.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment