'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var App = _interopDefault(require('./modules/App'));
var _Router = _interopDefault(require('./modules/Router'));
var Utils = require('./modules/Utils');

var main = {
  /**
   * sets the global callback error handler
   * @param errorCallback global error callback
   */
  setGlobalErrorCallback: function setGlobalErrorCallback(errorCallback) {
    Utils.setErrorCallback(errorCallback);
  },

  /**
   * creates an r server app instance
   * @param config - config file location or configuration object, defaults to .server.js
   */
  create: function create() {
    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '.server.js';
    return new App(config);
  },

  /**
   * creates a mountable router
   * @param inheritMiddlewares - indicates if parent middlewares should be inherited
   */
  Router: function Router() {
    var inheritMiddlewares = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
    return new _Router(inheritMiddlewares);
  }
};

module.exports = main;
//# sourceMappingURL=main.js.map
