Query the running proxy HTTP API
(path: string, port: number)
| 91 | |
| 92 | /** Query the running proxy HTTP API */ |
| 93 | async function queryProxy(path: string, port: number): Promise<unknown> { |
| 94 | const res = await fetch(`http://127.0.0.1:${port}${path}`); |
| 95 | if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`); |
| 96 | return res.json(); |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * Pipe text into the system clipboard via the platform-native command. |