-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.js
25 lines (18 loc) · 863 Bytes
/
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
const dotenv = require('dotenv');
const environmentVariables = dotenv.config();
if ( environmentVariables.error ) { throw environmentVariables.error; }
const language = process.env.language || 'en'
const embyAPI = {
api_key: process.env.emby_api_key || undefined,
host: process.env.emby_host || undefined,
// endpoint key and value will be populated later in the code.
}
if (embyAPI.api_key == undefined ) { throw new Error('[EMBY]: API_KEY is required.'); }
if (embyAPI.host == undefined ) { throw new Error('[EMBY]: Server IP/FQDN was not supplied.') }
embyAPI.endpoint = `${embyAPI.host}/emby/`
const tmdbAPI = {
api_key: process.env.tmdb_api_key || undefined,
endpoint: 'https://api.themoviedb.org/3/',
}
if (tmdbAPI.api_key == undefined ) { throw new Error('[TMDB]: API_KEY is required.'); }
module.exports = { language, embyAPI, tmdbAPI };