{"size": 1170, "ext": "js", "max_stars_repo_path": "src/GenerateApp/GenerateApp/wwwroot/GenerateAll/Backend/express-api-template/index.js", "max_stars_repo_name": "ignatandrei/generateApp", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/GenerateApp/GenerateApp/wwwroot/GenerateAll/Backend/express-api-template/index.js", "max_issues_repo_name": "ignatandrei/generateApp", "max_issues_repo_issues_event_min_datetime": "2020-07-31T23:59:59.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-21T01:38:57.000Z", "max_forks_repo_path": "src/GenerateApp/GenerateApp/wwwroot/GenerateAll/Backend/express-api-template/index.js", "max_forks_repo_name": "ignatandrei/generateApp", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 52, "max_forks_count": null, "avg_line_length": 32.5, "max_line_length": 76, "alphanum_fraction": 0.5324786325}
const log = require('./src/logger');
const printMessage = require('print-message');
const {appConfig} = require("./src/config");
const {appExpress} = require("./src/express/express-config");
const {apiVersion} = require("./src/helpers/api-version");
const listEndpoints = require("express-list-endpoints");

(() => {
    try {
        const config = appConfig();
        const app = appExpress();

        const {ListEndpoints} = require('./src/helpers/list-api-endpoints');
        ListEndpoints(listEndpoints(app)).then(routes => {
            // Print out a beautiful start message
            printMessage([
                `API`,
                `ver: ${apiVersion()}`,
                '',
                `Api listens on port: ${config.apiPort}`,
                `Main route /${appConfig().apiRouteMain}/`,
                ...routes,
                '',
                '© 2020 - Generated with Data To Code#'
            ]);
            //END - Print out a beautiful start message

            log.info(`Environment var: ${JSON.stringify(process.env)}`);
        });

        module.exports.app = appExpress;
    } catch (ex) {
        log.error(ex);
    }
})();
