mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-02 16:32:14 +00:00
fix(frontend): use configured API base for direct requests
Route direct fetch calls, setup requests, gateway usage checks, and ops WebSocket connections through the configured API base instead of assuming same-origin backend paths. Also derive OAuth callback suggestions from the configured API base so split frontend/API deployments show usable redirect URLs.
This commit is contained in:
1 parent
85a3b12254
commit
2a58a57a7c
13 files changed
+72
-45
No files matched your search
@@ -2,10 +2,11 @@
|
||||
* Setup API endpoints
|
||||
*/
|
||||
import axios from 'axios'
|
||||
import { buildGatewayUrl } from './url'
|
||||
|
||||
// Create a separate client for setup endpoints (not under /api/v1)
|
||||
const setupClient = axios.create({
|
||||
baseURL: '',
|
||||
baseURL: buildGatewayUrl('/').replace(/\/+$/, ''),
|
||||
timeout: 30000,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
||||
Reference in new issue
Block a user