From fa26c50ebc14ebf1340fe6430d10c704620a1dac Mon Sep 17 00:00:00 2001 From: FragginWagon Date: Thu, 29 Jan 2026 14:27:08 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Update=20Challonge=20API=20proxy?= =?UTF-8?q?=20configuration=20to=20simplify=20URL=20rewriting=20and=20enfo?= =?UTF-8?q?rce=20nginx=20proxy=20usage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/websites/pokedex.online/nginx.conf | 2 +- .../pokedex.online/src/services/challonge-v2.1.service.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/code/websites/pokedex.online/nginx.conf b/code/websites/pokedex.online/nginx.conf index 8e93357..1b3fa45 100644 --- a/code/websites/pokedex.online/nginx.conf +++ b/code/websites/pokedex.online/nginx.conf @@ -68,7 +68,7 @@ server { # Proxy Challonge API requests to avoid CORS location /api/challonge/ { # Remove /api/challonge prefix and forward to Challonge API - rewrite ^/api/challonge/(.*) /v1/$1 break; + rewrite ^/api/challonge/(.*) /$1 break; proxy_pass https://api.challonge.com; proxy_ssl_server_name on; diff --git a/code/websites/pokedex.online/src/services/challonge-v2.1.service.js b/code/websites/pokedex.online/src/services/challonge-v2.1.service.js index 7396366..e91fe43 100644 --- a/code/websites/pokedex.online/src/services/challonge-v2.1.service.js +++ b/code/websites/pokedex.online/src/services/challonge-v2.1.service.js @@ -15,12 +15,10 @@ /** * Get the appropriate base URL based on environment + * Always use nginx proxy to avoid CORS issues */ function getBaseURL() { - if (import.meta.env.DEV) { - return '/api/challonge/v2.1'; - } - return 'https://api.challonge.com/v2.1'; + return '/api/challonge/v2.1'; } /**