Download assets/js/domain-utils.js from EDUrocks/EDUrocks-3.0-frontend-source-code: direct link, hf CLI and curl.
- Browser
- Download file 935 Bytes
-
https://huggingface.co/datasets/EDUrocks/EDUrocks-3.0-frontend-source-code/resolve/main/assets/js/domain-utils.js
- Command line
-
hf download hf://datasets/EDUrocks/EDUrocks-3.0-frontend-source-code/assets/js/domain-utils.js
-
curl -L -o domain-utils.js https://huggingface.co/datasets/EDUrocks/EDUrocks-3.0-frontend-source-code/resolve/main/assets/js/domain-utils.js
935 Bytes
| /** | |
| * EDUrocks 3.0 - Domain Utilities | |
| * Handles domain detection and proxy URL generation | |
| */ | |
| export function getCurrentDomain() { | |
| let domain = window.location.hostname; | |
| // Remove specific subdomains (www, devbuild) to get root domain | |
| if (domain.startsWith('www.')) { | |
| domain = domain.substring(4); | |
| } else if (domain.startsWith('devbuild.')) { | |
| domain = domain.substring(9); | |
| } | |
| return domain; | |
| } | |
| export function getProxyURL() { | |
| // If AWS detection has set eduBackendRoot to rockedu.site, use that for proxy too | |
| if (window.eduBackendRoot && window.eduBackendRoot.includes('rockedu.site')) { | |
| return 'https://vedap.rockedu.site'; | |
| } | |
| // Otherwise use the current domain | |
| const domain = getCurrentDomain(); | |
| return `https://vedap.${domain}`; | |
| } | |
| // Make available globally for compatibility | |
| window.getCurrentDomain = getCurrentDomain; | |
| window.getProxyURL = getProxyURL; | |