function imperioMiddleware(req, res, next) {
      // Provide useragent properties to the imperio object
      req.imperio.isDesktop = req.useragent.isDesktop;
      req.imperio.isMobile = req.useragent.isMobile;

      if (req.method === 'GET') {
        // check for nonce in param and query and create session if not found
        that.connectionController.handleGet(req, res, that.activeConnectRequests);
      } else if (req.method === 'POST') {
        // Else if this is a post request (for now, at '/'), run these
        // 'codeCheck' is our currently provided var in the body to attach the nonce
        // TODO: make codeCheck configurable in the user config.
        that.connectionController.handlePost(req, res, that.activeConnectRequests, 'codeCheck');
      }

      // Execute the next middleware function in the express middleware chain
      next();
    }
/**
     * Handles socket room connection and authentication
     * @param {Object} req - request object
     * @param {Object} res - response object
     * @param {function} next - callback function to continue middleware chain
     */
Handles socket room connection and authentication
@param {Object} req - request object
@param {Object} res - response object
@param {function} next - callback function to continue middleware chain
Handles socket room connection and authentication @param { Object } req - request object @param { Object } res - response object @param { function } next - callback function to continue middleware chain
function imperioMiddleware(req, res, next) {
      req.imperio.isDesktop = req.useragent.isDesktop;
      req.imperio.isMobile = req.useragent.isMobile;
      if (req.method === 'GET') {
        that.connectionController.handleGet(req, res, that.activeConnectRequests);
      } else if (req.method === 'POST') {
        that.connectionController.handlePost(req, res, that.activeConnectRequests, 'codeCheck');
      }
      next();
    }
function imperioMiddleware ( req , res , next ) { req . imperio . isDesktop = req . useragent . isDesktop ; req . imperio . isMobile = req . useragent . isMobile ; if ( req . method === 'GET' ) { that . connectionController . handleGet ( req , res , that . activeConnectRequests ) ; } else if ( req . method === 'POST' ) { that . connectionController . handlePost ( req , res , that . activeConnectRequests , 'codeCheck' ) ; } next ( ) ; }
Handles socket room connection and authentication
 @param {Object} req - request object
 @param {Object} res - response object
 @param {function} next - callback function to continue middleware chain
Handles socket room connection and authentication @param { Object } req - request object @param { Object } res - response object @param { function } next - callback function to continue middleware chain
// Provide useragent properties to the imperio object // check for nonce in param and query and create session if not found // Else if this is a post request (for now, at '/'), run these // 'codeCheck' is our currently provided var in the body to attach the nonce // TODO: make codeCheck configurable in the user config. // Execute the next middleware function in the express middleware chain