Feat: Natively support NETIFY environment variables and improve MongoDB detection based on URI presence
This commit is contained in:
1 parent
eedaa588b5
commit
2be8b08074
8 files changed
+16
-16
No files matched your search
@@ -20,8 +20,8 @@ module.exports = async function appDetailsHandler(req, res, helpers) {
|
||||
const label = String(req.query.label ?? '');
|
||||
if (!label) return res.status(400).json({ ok: false, message: 'label required' });
|
||||
|
||||
const token = process.env.BACKONE_DPI_API_KEY || process.env.BACKONE_TOKEN;
|
||||
const SITE_UUID = process.env.BACKONE_SITE_UUID;
|
||||
const token = process.env.BACKONE_DPI_API_KEY || process.env.NETIFY_API_KEY || process.env.BACKONE_TOKEN || process.env.NETIFY_TOKEN;
|
||||
const SITE_UUID = process.env.BACKONE_SITE_UUID || process.env.NETIFY_SITE_UUID;
|
||||
|
||||
// Respect timeRange from request
|
||||
const timeFilter = getTimeFilter(req);
|
||||
@@ -39,7 +39,7 @@ module.exports = async function appDetailsHandler(req, res, helpers) {
|
||||
|
||||
if (deviceApps.length > 0) {
|
||||
// Pre-load application lookup to resolve default domains
|
||||
const BASE_URL = process.env.BACKONE_INFORMATICS_BASE_URL || 'https://api0.dev.backone.cloud/api/v1';
|
||||
const BASE_URL = process.env.BACKONE_INFORMATICS_BASE_URL || process.env.NETIFY_INFORMATICS_BASE_URL || 'https://api0.dev.backone.cloud/api/v1';
|
||||
if (token && SITE_UUID) {
|
||||
await populateAppCache(BASE_URL, token, SITE_UUID).catch(e => console.warn('[AppDetails] Cache error:', e.message));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user