API methods available through socket.io?

31 views
Skip to first unread message

jfgorski

unread,
May 28, 2014, 10:39:00 PM5/28/14
to res...@googlegroups.com
Is there functionality to make the API defined on the Restify server available through socket.io? I haven't thought through all the details, but I mean something like

var server = restify.createServer();
var io = socketio.listen(server);

server.post(...)
server.get(...)
io.sockets.on('connection', function (socket) { server.attachToSocket(socket) });

Then the socket would be endowed with an event called "restify", say, which could take an object specifying a API request, and the reply acknowledgement would have the API response.

Reply all
Reply to author
Forward
0 new messages