Use RODA server for dashboard proxy

This commit is contained in:
GuavaPopper
2026-06-05 17:04:04 +07:00
parent 1a90411509
commit 1a8130f720
4 changed files with 29 additions and 14 deletions
+3 -3
View File
@@ -76,6 +76,7 @@
window.APP_CONFIG = window.APP_CONFIG || {
debugLogs: false,
dashboardRuntimeFetch: 'always',
dashboardApiUrl: 'api/dashboard',
dashboardTargetUrl: 'https://dashboard.informatika.untan.ac.id/index.php?penelitian',
dashboardProxyTemplates: [
'https://api.codetabs.com/v1/proxy?quest={{url}}',
@@ -1677,14 +1678,13 @@
}
const targetUrl = window.APP_CONFIG?.dashboardTargetUrl?.trim();
const dashboardApiUrl = window.APP_CONFIG?.dashboardApiUrl?.trim();
const proxyTemplates = Array.isArray(window.APP_CONFIG?.dashboardProxyTemplates)
? window.APP_CONFIG.dashboardProxyTemplates.filter(Boolean)
: [];
// Endpoint server.js hanya ada saat development lokal.
const proxyServers = shouldUseLocalDashboardProxy() ? [() => '/api/dashboard'] : [];
const proxyServers = dashboardApiUrl ? [() => dashboardApiUrl] : [];
// Deployment static memakai proxy publik karena tidak menjalankan server.js.
if (targetUrl) {
proxyTemplates.forEach((template) => {
proxyServers.push((url) => template