forked from smart-facility/cognicity-reports-detik
-
Notifications
You must be signed in to change notification settings - Fork 0
/
detik-config.js
30 lines (25 loc) · 1.37 KB
/
detik-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'use strict';
require('dotenv').config();
// sample-detik-config.js - sample configuration file for cognicity-reports-detik module
/**
* Configuration for cognicity-reports-detik
* @namespace {object} config
* @property {object} detik Configuration object for Detik web service interface
* @property {string} detik.serviceURL The URL for the Detik web service, including topic ID and not including page number
* @property {number} detik.pollInterval Poll interval for web service in milliseconds
* @property {number} detik.historicalLoadPeriod Maximum age in milliseconds of reports which will be processed
* @property {object} detik.pg Postgres database configuration options
* @property {string} detik.pg.table_detik Database table used to store Detik reports
* @property {string} detik.pg.table_detik_users Database table used to store Detik counts per user
*/
var config = {};
// Detik web service API
config.detik = {};
config.detik.serviceURL = process.env.DETIK_URL; // E.g. https://example.com/latest?topic=2
config.detik.pollInterval = 1000 * 60 * 5; // E.g. 1000 * 60 * 5 = 5min
config.detik.historicalLoadPeriod = 1000 * 60 * 60; // E.g. 1000 * 60 * 60 = 1hr
// Detik configuration for cognicity-schema
config.detik.pg = {};
config.detik.pg.table_detik = 'detik.reports';
config.detik.pg.table_detik_users = 'detik.users';
module.exports = config;