mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-24 09:35:05 +00:00
core: restore plugin serverUrl getter so plugins can connect to local server
This commit is contained in:
@@ -35,7 +35,7 @@ export namespace Plugin {
|
|||||||
worktree: Instance.worktree,
|
worktree: Instance.worktree,
|
||||||
directory: Instance.directory,
|
directory: Instance.directory,
|
||||||
get serverUrl(): URL {
|
get serverUrl(): URL {
|
||||||
throw new Error("Server URL is no longer supported in plugins")
|
return Server.url ?? new URL("http://localhost:4096")
|
||||||
},
|
},
|
||||||
$: Bun.$,
|
$: Bun.$,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -585,6 +585,9 @@ export namespace Server {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @deprecated do not use this dumb shit */
|
||||||
|
export let url: URL
|
||||||
|
|
||||||
export function listen(opts: {
|
export function listen(opts: {
|
||||||
port: number
|
port: number
|
||||||
hostname: string
|
hostname: string
|
||||||
@@ -592,6 +595,7 @@ export namespace Server {
|
|||||||
mdnsDomain?: string
|
mdnsDomain?: string
|
||||||
cors?: string[]
|
cors?: string[]
|
||||||
}) {
|
}) {
|
||||||
|
url = new URL(`http://${opts.hostname}:${opts.port}`)
|
||||||
const app = createApp(opts)
|
const app = createApp(opts)
|
||||||
const args = {
|
const args = {
|
||||||
hostname: opts.hostname,
|
hostname: opts.hostname,
|
||||||
|
|||||||
Reference in New Issue
Block a user