This is what i got so far
var express = require('express');
var app = express();
app.get('/data', function(req, res){
res.send('hello world'); //replace with your data here
});
app.listen(8888);
the html
<div id="test"></div>
<input type="button" id="but" value="Link">
<script>
$(document).ready(function() {
$('#but').click(function(){
$.get('http://localhost:8888/data', {}, function(data){
$("#test").append(data);
});
});
});
</script>
I just want to display the hello world inside the div can somebody please help?