text: 'use strict';
  
  var fs = require('fs'),
    http = require('http'),
    path = require('path');
  
  var express = require("express");
  var app = express();
  var bodyParser = require('body-parser');
  app.use(bodyParser.json({
    strict: false,
    limit: '50mb'
  }));
  
  
  var oasTools = require('oas-tools');
  var jsyaml = require('js-yaml');
  var serverPort = process.env.PORT || 8080;
  
  var spec = fs.readFileSync(path.join(__dirname, '/api/oas-doc.yaml'), 'utf8');
  var oasDoc = jsyaml.safeLoad(spec);
  
  var options_object = {
    controllers: path.join(__dirname, './controllers'),
    loglevel: 'error',
    strict: false,
    router: true,
    validator: true
  };
  
  oasTools.configure(options_object);
  
  oasTools.initialize(oasDoc, app, function () {
    http.createServer(app).listen(serverPort, function () {
      console.log("App running at http://localhost:" + serverPort);
      console.log("________________________________________________________________");
      if (options_object.docs !== false) {
        console.log('API docs (Swagger UI) available on http://localhost:' + serverPort + '/docs');
        console.log("________________________________________________________________");
      }
    });
  });
  
  app.get('/', function (req, res) {
    res.redirect('/docs');
  });