docs: function serve(specDir, port, cb) {
    var app = express();
  
    var markdownOptions = {
      imageRenderer: imageRenderer,
      linkRenderer: linkRenderer
    };
  
    app.disable('x-powered-by');
  
    // serve static files from the `public` folder
    app.use('/', express.static(path.join(__dirname, '..', 'public')));
  
    // serve static raw files from the specification source dir directory
    app.use('/api/rest/raw', express.static(specDir, {
      index: false
    }));
  
    app.get('/api/rest/metadata', function (req, res, next) {
      featurebook.readMetadata(specDir, function (err, metadata) {
        if (err) {
          return next(err);
        } else {
          res.send(metadata);
        }
      });
    });
  
    // returns parsed summary or 404 if SUMMARY.md is not present
    app.get('/api/rest/summary/:path?', function (req, res, next) {
      var summaryDir = req.params.path ? path.join(specDir, req.params.path) : specDir;
      featurebook.readSummary(summaryDir, function (err, summary) {
        if (err) {
          return next(err);
        } else if (summary !== null) {
          res.send(markdown.render(summary, markdownOptions));
        } else {
          res.status(NOT_FOUND).end();
        }
      });
    });
  
    app.get('/api/rest/spec/tree', function (req, res, next) {
      featurebook.readSpecTree(specDir, function (err, specTree) {
        if (err) {
          return next(err);
        } else {
          res.send(specTree);
        }
      });
    });
  
    app.get('/api/rest/feature/:path', function (req, res) {
      featurebook.readFeature(path.join(specDir, req.params.path), function (err, feature) {
        var responseBody = {};
        if (err) {
          responseBody.status = 'error';
          responseBody.message = 'Unable to parse the feature file: ' + err;
        } else {
          responseBody.status = 'success';
          responseBody.data = markdown.descriptionMarkdownToHTML(feature, markdownOptions);
        }
        res.send(responseBody);
      });
    });
  
    app.use(function (err, req, res, next) {
      res.status(INTERNAL_SERVER_ERROR).send({error: err.message});
    });
  
    app.listen(port, cb);
  
    return app;
  }