all files / generators/api/config/ index.js

100% Statements 8/8
100% Branches 0/0
100% Functions 3/3
100% Lines 8/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23                             
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * Class which generates string content for main js file
 *
 * @export
 * @class Index
 */
var Index = (function () {
    function Index() {
    }
    /**
     * Generate main js file string content
     * @return {string} - generated content for index.js file
     */
    Index.prototype.getIndex = function () {
        return "const express = require('express');\nconst profile = require('./configs/index.js').getEnvBasedConfig();\nconst loadExpressConfig = require('./configs/express.js');\nconst router = require('./configs/router.js');\n\nlet app = express();\napp = loadExpressConfig(app);\n\napp.use('/', router);\n\napp.listen(profile.APP_PORT, () => {\n  console.log('App started on port: ' + profile.APP_PORT);\n});";
    };
    return Index;
}());
exports.Index = Index;
exports.default = new Index();