mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-17 03:20:40 +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:
+2
-2
@@ -19,7 +19,7 @@ export class ApiClient {
|
||||
state: AgentState | null
|
||||
}): Promise<Session> {
|
||||
const response = await axios.post<CreateSessionResponse>(
|
||||
`${configuration.serverUrl}/cli/sessions`,
|
||||
`${configuration.apiUrl}/cli/sessions`,
|
||||
{
|
||||
tag: opts.tag,
|
||||
metadata: opts.metadata,
|
||||
@@ -79,7 +79,7 @@ export class ApiClient {
|
||||
runnerState?: RunnerState
|
||||
}): Promise<Machine> {
|
||||
const response = await axios.post<CreateMachineResponse>(
|
||||
`${configuration.serverUrl}/cli/machines`,
|
||||
`${configuration.apiUrl}/cli/machines`,
|
||||
{
|
||||
id: opts.machineId,
|
||||
metadata: opts.metadata,
|
||||
|
||||
@@ -215,7 +215,7 @@ export class ApiMachineClient {
|
||||
}
|
||||
|
||||
connect(): void {
|
||||
this.socket = io(`${configuration.serverUrl}/cli`, {
|
||||
this.socket = io(`${configuration.apiUrl}/cli`, {
|
||||
transports: ['websocket'],
|
||||
auth: {
|
||||
token: this.token,
|
||||
|
||||
@@ -71,7 +71,7 @@ export class ApiSessionClient extends EventEmitter {
|
||||
registerCommonHandlers(this.rpcHandlerManager, this.metadata.path)
|
||||
}
|
||||
|
||||
this.socket = io(`${configuration.serverUrl}/cli`, {
|
||||
this.socket = io(`${configuration.apiUrl}/cli`, {
|
||||
auth: {
|
||||
token: this.token,
|
||||
clientType: 'session-scoped' as const,
|
||||
@@ -270,7 +270,7 @@ export class ApiSessionClient extends EventEmitter {
|
||||
let cursor = startSeq
|
||||
while (true) {
|
||||
const response = await axios.get(
|
||||
`${configuration.serverUrl}/cli/sessions/${encodeURIComponent(this.sessionId)}/messages`,
|
||||
`${configuration.apiUrl}/cli/sessions/${encodeURIComponent(this.sessionId)}/messages`,
|
||||
{
|
||||
params: { afterSeq: cursor, limit },
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user