Source: lib/middlewares/swagger.js

/**
 * ### Swagger Middleware
 *
 * This middleware handles Swagger logic which means
 *
 *   - It takes care of routing, and calls Swagger controllers (/api/controllers)
 *   for each route;
 *   - It validates both the request and the response, enforcing type checks on
 *   both ends;
 *   - It documents the API
 *   - It serves as a nice UI for manual testing
 *
 * @module Middlewares/Swagger
 */
"use strict";

const path = require("path");

const BPromise = require("bluebird");

const swaggerLib = require(path.resolve(__dirname, "../swagger"));

module.exports = BPromise.try(() => swaggerLib.initMiddleware());