title: Socket.IO on controller
body: <p>I'm pretty new to sockets and I've been struggling to implement some of the documentation i've seen online. This is my set up currently and I wanted to run socket.io against just the healthcheck api endpoint (/api/v1/healthcheck) how would I go about running socket io in the healthcheck controller? and emit changes to the response? Any help is appreciated, i'm tearing my hair out :(</p>
  
  <p><strong>Server.js</strong></p>
  
  <pre><code>const socket = require('socket.io')
  
  const healthcheck = require('./routes/healthcheck');
  const auth = require('./routes/auth');
  const users = require('./routes/users');
  
  const server = app.listen(
    PORT,
    console.log(
      `Server running in ${process.env.NODE_ENV} mode on port ${PORT}`.cyan.bold
    )
  );
  
  let io = require('socket.io')(server);
  app.set("io", io);
  
  //Auth
  app.use('/api/v1/auth', auth);
  app.use('/api/v1/users', users);  
  //Health check
  app.use('/api/v1/healthcheck', healthcheck);
  </code></pre>
  
  <p><strong>/routes/healthcheck.js</strong></p>
  
  <pre><code>const express = require('express');
  const { checkHealth } = require('../controllers/healthcheck');
  
  const router = express.Router();
  
  router.post('/', checkHealth);
  
  module.exports = router;
  </code></pre>
  
  <p><strong>/controllers/healthcheck.js</strong></p>
  
  <pre><code>const asyncHandler = require('../middleware/async');
  
  exports.checkHealth = asyncHandler(async (req, res, next) =&gt; {
      res.status(200).json({
          success: true,
          data: {
              status: "Alive!"
          }
      });
  });
  </code></pre>