mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-24 04:47:03 +00:00
refactor: rename configuration variables for clarity
Standardize naming across CLI and server components: - CLI: serverUrl → apiUrl, HAPI_SERVER_URL → HAPI_API_URL - Server: webapp* → listen*, miniAppUrl → publicUrl, WEBAPP_* → HAPI_LISTEN_*, WEBAPP_URL → HAPI_PUBLIC_URL - Rename serverUrlInit.ts → apiUrlInit.ts with updated logic for backward compatibility - Update all imports, function calls, and documentation accordingly
This commit is contained in:
@@ -12,15 +12,15 @@ import { stdin as input, stdout as output } from 'node:process'
|
||||
import chalk from 'chalk'
|
||||
import { configuration } from '@/configuration'
|
||||
import { readSettings, updateSettings } from '@/persistence'
|
||||
import { initializeServerUrl } from '@/ui/serverUrlInit'
|
||||
import { initializeApiUrl } from '@/ui/apiUrlInit'
|
||||
|
||||
/**
|
||||
* Initialize CLI API token
|
||||
* Must be called before any API operations
|
||||
*/
|
||||
export async function initializeToken(): Promise<void> {
|
||||
// Initialize server URL first (env > settings.json > default)
|
||||
await initializeServerUrl()
|
||||
// Initialize API URL first (env > settings.json > default)
|
||||
await initializeApiUrl()
|
||||
|
||||
// 1. Environment variable has highest priority (allows temporary override)
|
||||
if (configuration.cliApiToken) {
|
||||
|
||||
Reference in New Issue
Block a user