function parseInstance
parseInstance(input: string): string | null

Returns the origin of the instance input names, or null when it names none. Someone may type a bare host (music.example, taken as https), a URL, or a handle's host with its port (localhost:8001); a URL with a path names no instance. Whether plain http is allowed is the server's call.

Parameters

input: string

Return Type

string | null

Usage

import { parseInstance } from "shared/federation.ts";