From ead516a9d74f346c4556c7eaab7014f95486f29e Mon Sep 17 00:00:00 2001 From: Ben Beltran Date: Mon, 28 Nov 2016 02:28:17 -0600 Subject: LGTM-2 Read from database Squashed commit of the following: commit a2a2b553f69a66f1825347abde4f0028773bdbdb Author: Ben Beltran Date: Mon Nov 28 02:27:19 2016 -0600 Fetch random record in record_fetcher commit 6b98202fc8ea9c5811134cad592f11b6b89d008a Author: Ben Beltran Date: Mon Nov 28 02:27:08 2016 -0600 Add some instructions to the readme commit f5efb2b5de23844e6317a6f636abb75955e60c40 Author: Ben Beltran Date: Mon Nov 28 02:26:57 2016 -0600 Add DB setup script commit d6d8813ef55bb1297089c9dbb87a9ab86e6c5ba2 Author: Ben Beltran Date: Mon Nov 28 02:26:34 2016 -0600 Add dotenv to the configs commit 649f66982d2152d36a782577043505835f235987 Author: Ben Beltran Date: Mon Nov 28 01:29:49 2016 -0600 Use a template instead of static html index --- config/config.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/config.js b/config/config.js index 3204568..ddfdb41 100644 --- a/config/config.js +++ b/config/config.js @@ -1,10 +1,24 @@ 'use strict'; const Getenv = require('getenv'); +const Dotenv = require('dotenv'); + +Dotenv.config(); const internals = {}; module.exports = internals.Config = { - port: Getenv.int('LGTM_PORT', 1728), - staticDirectory: Getenv('LGTM_STATIC_DIRECTORY', 'static') + port: Getenv.int('LGTM_PORT', 1728), // Port to listen on + staticDirectory: Getenv('LGTM_STATIC_DIRECTORY', 'static'), // Location of static assets + templateDirectory: Getenv('LGTM_TEMPLATE_DIRECTORY', 'templates'), // Location of templates + + // Config to connect to mysql + mysql: { + host: Getenv('LGTM_MYSQL_HOST', 'localhost'), + port: Getenv('LGTM_MYSQL_PORT', 3306), + user: Getenv('LGTM_MYSQL_USER'), + password: Getenv('LGTM_MYSQL_PASSWORD'), + database: Getenv('LGTM_MYSQL_DATABASE'), + tableName: Getenv('LGTM_MYSQL_TABLE_NAME', 'lgtm') // table that will be used to fetch logs + } }; -- cgit