'use strict';

const express = require('express');
const cors = require('cors');
const MockCtrl = require('../controllers/MockCtrl');

module.exports = function({Configuration, Logger, app}) {
  // Cross-domain management
  app.use(cors());

  // HeartBeat test
  app.use(express.static('./public'));

  // Main route
  app.all('/api*', function(req, res) {
    new MockCtrl({Configuration, Logger}).buildResponse(req, res);
  });
};

'use strict';

const express = require('express');
const cors = require('cors');
const MockCtrl = require('../controllers/MockCtrl');

module.exports = function({Configuration, Logger, app}) {
  // Cross-domain management
  app.use(cors());

  // HeartBeat test
  app.use(express.static('./public'));

  // Main route
  app.use(function(req, res) {
    new MockCtrl({Configuration, Logger}).buildResponse(req, res);
  });
};

Modify main route in order to remove the need of prefixing the root mock folders by 'api'
Modify main route in order to remove the need of prefixing the root mock folders by 'api'
