Last active
December 23, 2015 13:49
-
-
Save daffl/6644854 to your computer and use it in GitHub Desktop.
Feathers rapid start example results
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// POST http://localhost:8000/todos | |
{ | |
"description": "You have to do dishes!" | |
} | |
// GET http://localhost:8000/todos | |
[ | |
{ | |
"id": 0, | |
"description": "You have to do dishes!" | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://localhost:8000/socket.io/socket.io.js"></script> | |
<script type="text/javascript"> | |
var socket = io.connect('http://localhost:8000/'); | |
socket.on('todos created', function(todo) { | |
console.log('Someone created a new Todo', todo); | |
}); | |
socket.emit('todos::create', { | |
description: 'You have to do something real-time!' | |
}, {}, function(error, todo) { | |
socket.emit('todos::find', {}, function(error, todos) { | |
console.log('Server todos:', todos); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment