MCPcopy
hub / github.com/anomalyco/opencode / normalizeServerUrl

Function normalizeServerUrl

packages/app/src/context/server.tsx:12–17  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

10const HEALTH_POLL_INTERVAL_MS = 10_000
11
12export function normalizeServerUrl(input: string) {
13 const trimmed = input.trim()
14 if (!trimmed) return
15 const withProtocol = /^https?:\/\//.test(trimmed) ? trimmed : `http://${trimmed}`
16 return withProtocol.replace(/\/+$/, "")
17}
18
19export function serverName(conn?: ServerConnection.Any, ignoreDisplayName = false) {
20 if (!conn) return ""

Callers 4

looksCompleteFunction · 0.90
previewStatusFunction · 0.90
addFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected