I'm trying to run some server only code from an event on the client in derby.js I'm using x-bind to bind the event on the view like so:
<a href="#" x-bind="click: func">click me</a>
and on the app:
exports.func=function(e,el,next){
// i want to run some server code here, but it runs on the client only
}
So:
- Can this be done in any way?
- if not, is there any way to use sockets in a 'native' way on derby.js
I simply don't want to fall back to ajax with server routes when all the rest is real time.