I have a simple but unusual problem.
I have a client page making requests to a RESTful API. So the client PUTs, no big deal. A form sends JSON to the API, and from there it is stored in the server database.
However, I have a separate page that is supposed to give me a current status from the database, say, a count of rows. I need the count to be updated every time a new row is created. The current solution is to send a GET request every 5 seconds or so, which is obviously not ideal. I don't want to query the database if there is no row created yet.
So I need a trigger on every row create. This seems trivial to implement in app/api/Controllers/AppController.js
. However, in this file I have a reference to the PUTting client, not the GETting one. How can I reference the GETting client there?