1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | const createConfig = exports.createConfig = (provided = {}) => ({
|
7 | mainframe_secret: provided.mainframe_secret || process.env.MAINFRAME_SECRET || '',
|
8 | mainframe_url: provided.mainframe_url || process.env.MAINFRAME_URL || 'https://api.mainframe.com/bots/v1',
|
9 | port: provided.port || process.env.PORT ? parseInt(process.env.PORT, 10) : 4000
|
10 | });
|
11 |
|
12 | const validateConfig = exports.validateConfig = config => {
|
13 | if (!config.mainframe_secret) {
|
14 | throw new Error('Missing Mainframe secret');
|
15 | }
|
16 | }; |
\ | No newline at end of file |