]> git.r.bdr.sh - rbdr/lgtm/blobdiff - config/config.js
Fetch random record in record_fetcher
[rbdr/lgtm] / config / config.js
index c98a0be024c20bb91e42c84dc241d0db1a6e5c4e..ddfdb41ab91c94ff39a741fb2760afaadf8a6ad3 100644 (file)
@@ -1,11 +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'),
-  templateDirectory: Getenv('LGTM_TEMPLATE_DIRECTORY', 'templates')
+  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
+  }
 };