mirror of
https://github.com/crabwise-ai/crabwalk.git
synced 2026-08-14 00:57:52 +00:00
Refactor Clawdbot client initialization to use configurable WebSocket URL
- Updated the Clawdbot client to accept a WebSocket URL from the environment variable `CLAWDBOT_URL`, defaulting to 'ws://127.0.0.1:18789' if not set. This change enhances flexibility for different deployment environments.
This commit is contained in:
@@ -241,8 +241,9 @@ let clientInstance: ClawdbotClient | null = null
|
||||
|
||||
export function getClawdbotClient(): ClawdbotClient {
|
||||
if (!clientInstance) {
|
||||
const url = process.env.CLAWDBOT_URL || 'ws://127.0.0.1:18789'
|
||||
const token = process.env.CLAWDBOT_API_TOKEN
|
||||
clientInstance = new ClawdbotClient('ws://127.0.0.1:18789', token)
|
||||
clientInstance = new ClawdbotClient(url, token)
|
||||
}
|
||||
return clientInstance
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user