SettingsΒΆ

Values that might change depending on your environment are managed with the help of config.

The default values are kept in config/default.js:

"use strict";

module.exports = {
    domain: "localhost",
    cors: {
        whitelist: [
            "http://localhost",
            "http://localhost:3000",
            "http://localhost:4200",
            "http://localhost:8080"
        ]
    },
    authorization_seed: "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",
    database: {
        host: "db",
        username: "root",
        password: "123.456",
        database: "cric",
        dialect: "mysql",
        timezone: "-03:00",
        define: {
            charset: "utf8",
            collate: "utf8_general_ci",
            underscored: true,
            timestamps: true
        },
        pool: {
            max: 5,
            idle: 30000,
            acquire: 60000
        },
        logging: console.log
    },
    nodemailer: {
        host: 'localhost',
        port: 587,
        auth: {
            user: 'youremail@localhost',
            pass: 'yourpassword'
        }
    }
};

Values used in production mode are kept in config/production.js:

/* Enable with `export NODE_ENV=production` */

"use strict";

module.exports = {
    domain: "api.database.cric.com.br",
    cors: {
        whitelist: [
            "http://cric.com.br",
            "http://database.cric.com.br",
            "http://api.database.cric.com.br",
            "https://cric.com.br",
            "https://database.cric.com.br",
            "https://api.database.cric.com.br"
        ]
    },
    authorization_seed: "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",
    database: {
        host: "db",
        username: "root",
        password: "123.456",
        database: "cric",
        dialect: "mysql",
        timezone: "-03:00",
        define: {
            charset: "utf8",
            collate: "utf8_general_ci",
            underscored: true,
            timestamps: true
        },
        pool: {
            max: 5,
            idle: 30000,
            acquire: 60000
        },
        logging: false
    },
    nodemailer: {
        host: 'localhost',
        port: 587,
        auth: {
            user: 'youremail@localhost',
            pass: 'yourpassword'
        }
    }
};

To enable production mode, run

$ export NODE_ENV=production

Some values will be override by environment variables as defined in config/custom-environment-variables.js:

/* environment variables to be check */

"use strict";

module.exports = {
    authorization_seed: "CRIC_AUTHORIZATION_SEED",
    database: {
        host: "CRIC_DB_HOST",
        database: "CRIC_DB_DATABASE",
        username: "CRIC_DB_USERNAME",
        password: "CRIC_DB_PASSWORD",
    },
    nodemailer: {
        host: "NODEMAILER_SERVICE",
        auth: {
            user: 'NODEMAILER_ADDRESS',
            pass: 'NODEMAILER_PASSWORD'
        }
    }
};

The override is design to be used by Kubernetes Secrets.

Some features require send email. Details of the SMTP server need to be provide. For developing, you can use Ethereal Email.