const development = {
    databaseURL: 'mongodb://mongo:27017',
    databaseName: 'DEVdashboardDB',
    port: 80,
    host: "localhost",

    website: {
        host: "website",
        port: 5005,
        
    },
    session: {
        host: "session",
        port: 5006
    },
    model: {
        host: "model",
        port: 5007,
        socketProtocol: "http",
        socketHost: "localhost",
        socketPort: 8080
    },
    account: {
        host: "account",
        port: 5008
    },
    printer: {
        host: "printer",
        port: 5009
    },
    evaluator: {
        host: "evaluator",
        port: 5010
    },
}

const production = {
    databaseURL: 'mongodb://mongo:27017',
    databaseName: 'dashboardDB',
    port: 80,
    host: "dashboard",
    
    website: {
        host: "website",
        port: 5005
    },
    session: {
        host: "session",
        port: 5006,
    },
    model: {
        host: "model",
        port: 5007,
        socketProtocol: process.env.PROTOCOL,
        socketPort: 80
    },
    account: {
        host: "account",
        port: 5008
    },
    printer: {
        host: "printer",
        port: 5009
    },
    evaluator: {
        host: "evaluator",
        port: 5010
    },
}

const github = {
    databaseURL: 'mongodb://mongo:27017',
    databaseName: 'dashboardDB',

    port: 80,
    host: "dashboard",
    website: {
        host: "website",
        port: 5005
    },
    session: {
        host: "session",
        port: 5006,
    },
    model: {
        host: "model",
        port: 5007,
        socketProtocol: "http",
        socketHost: "localhost",
        socketPort: 8080
    },
    account: {
        host: "account",
        port: 5008
    },
    printer: {
        host: "printer",
        port: 5009
    },
    evaluator: {
        host: "evaluator",
        port: 5010
    },
}
let config;
switch(process.env.NODE_ENV) {
    case 'github': 
        config = github
        break;
    case 'production':
        config = production
        break;
    case 'development': 
        config = development
        break;
    default: 
        config = development
}
module.exports = config
