Skip to content

Instantly share code, notes, and snippets.

@jeffbaumes
Last active December 23, 2015 07:19
Show Gist options
  • Save jeffbaumes/6599647 to your computer and use it in GitHub Desktop.
Save jeffbaumes/6599647 to your computer and use it in GitHub Desktop.
Tangelo basic example
<!DOCTYPE html>
<head>
<title>Reverser</title>
<!-- Boilerplate Javascript -->
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="/js/tangelo.js"></script>
<!-- The app's Javascript -->
<script src="myapp.js"></script>
</head>
<body>
<div>
<!-- Our little form to submit the text -->
<h2>Reverser</h2>
<div class="form-inline">
<input id="text" type="text">
<button id="go" class="btn btn-default">Go</button>
</div>
<!-- A place to show the output -->
<div id="output"></div>
</div>
</body>
$(function () {
$("#go").click(function () {
var text = $("#text").val();
$.getJSON("myservice?text=" + encodeURIComponent(text), function (data) {
$("#output").text(data.reversed);
});
});
});
def run(text=""):
return {"reversed": text[::-1]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment