mirror of
https://github.com/Inside4ndroid/TMDB-Embed-API.git
synced 2026-10-22 01:25:10 +00:00
13 lines
389 B
JavaScript
13 lines
389 B
JavaScript
const { config } = require('./config');
|
|
|
|
function getTmdbApiKey() {
|
|
if (config.tmdbApiKeys && config.tmdbApiKeys.length) {
|
|
const idx = Math.floor(Math.random() * config.tmdbApiKeys.length);
|
|
return config.tmdbApiKeys[idx];
|
|
}
|
|
// Fallback legacy single value (config or env)
|
|
return config.tmdbApiKey || process.env.TMDB_API_KEY || null;
|
|
}
|
|
|
|
module.exports = { getTmdbApiKey };
|