middleware/spec.js
function spec(req, res) {
    if (req.uri.pathname !== specification) return;

    res.statusCode = 200;
    res.setHeader('Content-Type', 'application/json');
    res.end(JSON.stringify(primus.spec));

    return true;
  }
function spec(req, res) {
    if (req.uri.pathname !== specification) return;

    res.statusCode = 200;
    res.setHeader('Content-Type', 'application/json');
    res.end(JSON.stringify(primus.spec));

    return true;
  }
function spec ( req , res ) { if ( req . uri . pathname !== specification ) return ; res . statusCode = 200 ; res . setHeader ( 'Content-Type' , 'application/json' ) ; res . end ( JSON . stringify ( primus . spec ) ) ; return true ; }
The actual HTTP middleware.

@param {Request} req HTTP request.
@param {Response} res HTTP response.
@api private
The actual HTTP middleware .