'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
+ }
};
"scripts": {
"lint": "eslint .",
"start": "node index",
+ "setup_database": "node scripts/setup_database",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
},
"homepage": "https://github.com/rbdr/lgtm#readme",
"dependencies": {
+ "dotenv": "^2.0.0",
"getenv": "^0.7.0",
"koa": "^1.2.4",
"koa-static": "^2.0.0",
version "1.0.4"
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
+dotenv:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-2.0.0.tgz#bd759c357aaa70365e01c96b7b0bec08a6e0d949"
+
ecc-jsbn@~0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505"