Skip to content

@robertklep /app.js
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
var express = require('express');
var app = express();
app.use(express.static(__dirname));
app.get('/search', function(req, res){
res.send({ hello : 'world' });
});
app.listen(3012);
<!doctype html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
$(function() {
$('#search').click(function(){
$.ajax({
type: "GET",
url: "/search",
dataType: "json"
}).done (function (data) {
alert(data);
console.log(data);
});
});
});
</script>
</head>
<body>
<button id="search">click</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.