Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ const path = require('path');
const logger = require('./lib/logger');

// Check if there is a `apps.json` in the config folder
if (!fs.existsSync(path.resolve(__dirname, '../config/apps.json'))) {
if (!process.env.APPS && !fs.existsSync(path.resolve(__dirname, '../config/apps.json'))) {
logger.error(
'Please copy the file "src/examples/apps.json" => "config/apps.json"',
);
process.exit(1);
}

// Check if there is a `config.json` in the config folder
if (!fs.existsSync(path.resolve(__dirname, '../config/config.json'))) {
if (!process.env.CONFIG && !fs.existsSync(path.resolve(__dirname, '../config/config.json'))) {
logger.error(
'Please copy the file "src/examples/config.json" => "config/config.json"',
);
Expand Down
8 changes: 4 additions & 4 deletions src/lib/prometheus.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ const client = require('prom-client');
const itunes = require('app-store-scraper');
const gplay = require('google-play-scraper');

// Config files
const config = require('../../config/config.json');
const apps = require('../../config/apps.json');
const metrics = require('../config/metrics.json');
// get config from docker environment variables or config files
const config = process.env.CONFIG ? JSON.parse(process.env.CONFIG) : require('../../config/config.json');
const apps = process.env.APPS ? JSON.parse(process.env.APPS) : require('../../config/apps.json');
const metrics = process.env.METRICS ? JSON.parse(process.env.METRICS) : require('../config/metrics.json');

const register = new client.Registry();

Expand Down