mardi 1 avril 2014

Sails 0.9.4, socket.io, newbie


Vote count:

0




Just getting started with Sails & Socket.io. I'm following the docs and setup a simple test project here:


http://ift.tt/1pEYgbm


According to the Sails docs, http://ift.tt/1s43pvy, socket subscriptions are setup on the first socket call:



socket.get(), socket.post(), etc. are methods available in the client-side SDK included in new Sails projects. In this example, we'll use them to talk to the backend via Socket.io. Please be aware that you can use these methods whether or not you're using CRUD blueprints.



The test project defines a quick model/controller, with CRUD methods. It connects to the socket using socket.get, and receives previously posted model instances correctly.


Posting a new instance using socket.post makes it to the Sails server and creates the new instance. However, the new instance is never sent to the connection created with socket.get.


Also, posting using a GET request from the browser hangs and never returns.


Am I reading the docs incorrectly or making some other newb mistake?


Thanks,


-- Tim



asked 5 mins ago






Aucun commentaire:

Enregistrer un commentaire