Skip to content

Instantly share code, notes, and snippets.

@daffl
Last active December 23, 2015 13:49
Show Gist options
  • Save daffl/6644854 to your computer and use it in GitHub Desktop.
Save daffl/6644854 to your computer and use it in GitHub Desktop.
Feathers rapid start example results
// POST http://localhost:8000/todos
{
"description": "You have to do dishes!"
}
// GET http://localhost:8000/todos
[
{
"id": 0,
"description": "You have to do dishes!"
}
]
<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