api.js
function getFn (req, res, next) {
    var reqPath = req.params[0];
    debug('getFn', 'reqPath', reqPath);

    stat(reqPath)
    .then(function (content) {
      if (!!content.type && content.type === 'file') {
        return res.sendFile(reqPath, { root: ramlPath });
      }
      res.status(200).json(content);
    }, function (err) {
      if (err === 'ENOENT') {
        return res.sendStatus(404);
      }
      next(err);
    });
  }
function getFn (req, res, next) {
    var reqPath = req.params[0];
    debug('getFn', 'reqPath', reqPath);

    stat(reqPath)
    .then(function (content) {
      if (!!content.type && content.type === 'file') {
        return res.sendFile(reqPath, { root: ramlPath });
      }
      res.status(200).json(content);
    }, function (err) {
      if (err === 'ENOENT') {
        return res.sendStatus(404);
      }
      next(err);
    });
  }
function getFn ( req , res , next ) { var reqPath = req . params [ 0 ] ; debug ( 'getFn' , 'reqPath' , reqPath ) ; stat ( reqPath ) . then ( function ( content ) { if ( ! ! content . type && content . type === 'file' ) { return res . sendFile ( reqPath , { root : ramlPath } ) ; } res . status ( 200 ) . json ( content ) ; } , function ( err ) { if ( err === 'ENOENT' ) { return res . sendStatus ( 404 ) ; } next ( err ) ; } ) ; }
manages file and directory retrieval
manages file and directory retrieval