{"size": 654, "ext": "js", "max_stars_repo_path": "src/init/index.js", "max_stars_repo_name": "feardarkness/phonebook-api", "max_stars_repo_stars_event_min_datetime": "2021-05-13T06:38:59.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-13T06:38:59.000Z", "max_issues_repo_path": "src/init/index.js", "max_issues_repo_name": "feardarkness/phonebook-api", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/init/index.js", "max_forks_repo_name": "feardarkness/phonebook-api", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.4347826087, "max_line_length": 73, "alphanum_fraction": 0.7079510703}
'use strict';

const express = require('express');
const events = require('events');
const routes = require('./routes');
const logger = require('../helpers/logger');
const middlewaresBefore = require('./middlewares/before');
const middlewaresAfter = require('./middlewares/after');

const app = express();
app.globalEventEmitter = new events.EventEmitter();

logger.info(`[${__filename}] *** Setting middlewares before routes ***`);
middlewaresBefore(app);

logger.info(`[${__filename}] *** Setting up routes ***`);
routes.init(app);

logger.info(`[${__filename}] *** Setting middlewares after routes ***`);
middlewaresAfter(app);

module.exports = app;
