title: Emit in socket.io after an express endpoint is hit
body: <p>I am new to sockets</p>
  
  <p>I am running an express webserver with a client who is using socket.io.</p>
  
  <p>Basically, whenever somebody hits one of my post requests, I would like to emit a result to my client indicating that the post request was hit. I envision it looking something like this.</p>
  
  <p><strong>Node Server</strong></p>
  
  <pre><code>const app = express();
  app.post('/makeOrder', function(req, res){ 
     // Do some database logic that pushes the order into my database
  
  
     // This is where I'm stuck.
     // I want to notify the client that the order is placed.
     // Would it look something like this?
     io.in('kitchenSocket').emit('order-placed', 'An order has been placed!');
  
  
     // Last send something to finish the request
     res.send({test:"order placed"})
  }
  </code></pre>
  
  <p><strong>Web Client</strong></p>
  
  <pre><code>&lt;script src="/socket.io.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      // What I currently have
      var socket = io.connect('http://localhost:5554/kitchenSocket');
      socket.on('order-placed', function (data) {
          alert("an order has been placed:" + data)
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>How can I get it to emit a message on an express endpoint being hit?</p>