std/http/server.ts

Deno standard library
Go to Latest
function _parseAddrFromStr
import { _parseAddrFromStr } from "https://deno.land/std@0.114.0/http/server.ts?s=_parseAddrFromStr";

Parse an address from a string.

Throws a TypeError when the address is invalid.

import { _parseAddrFromStr } from "https://deno.land/std@0.114.0/http/server.ts";

const addr = "::1:8000";
const listenOptions = _parseAddrFromStr(addr);

Parameters

addr: string[src]

The address string to parse.

optional
defaultPort
[src]

Default port when not included in the address string.

Returns

Deno.ListenOptions[src]

The parsed address.