mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 19:46:18 +00:00
Update api-config.ts
This commit is contained in:
@@ -3,6 +3,14 @@
|
|||||||
* Handles API URL generation with automatic proxy detection
|
* Handles API URL generation with automatic proxy detection
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API Server Port Configuration
|
||||||
|
* Default: 8008 (production)
|
||||||
|
* Can be changed to 8009 for beta testing
|
||||||
|
* This can also be set via NEXT_PUBLIC_API_PORT environment variable
|
||||||
|
*/
|
||||||
|
export const API_PORT = process.env.NEXT_PUBLIC_API_PORT || "8008"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the base URL for API calls
|
* Gets the base URL for API calls
|
||||||
* Automatically detects if running behind a proxy by checking if we're on a standard port
|
* Automatically detects if running behind a proxy by checking if we're on a standard port
|
||||||
@@ -30,8 +38,8 @@ export function getApiBaseUrl(): string {
|
|||||||
console.log("[v0] getApiBaseUrl: Detected proxy access, using relative URLs")
|
console.log("[v0] getApiBaseUrl: Detected proxy access, using relative URLs")
|
||||||
return ""
|
return ""
|
||||||
} else {
|
} else {
|
||||||
// Direct access - use explicit port 8008
|
// Direct access - use explicit API port
|
||||||
const baseUrl = `${protocol}//${hostname}:8008`
|
const baseUrl = `${protocol}//${hostname}:${API_PORT}`
|
||||||
console.log("[v0] getApiBaseUrl: Direct access detected, using:", baseUrl)
|
console.log("[v0] getApiBaseUrl: Direct access detected, using:", baseUrl)
|
||||||
return baseUrl
|
return baseUrl
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user