getResolvedHostForHttpServer() — astro Function Reference
Architecture documentation for the getResolvedHostForHttpServer() function in util.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 63a88fb0_88b4_3109_0f7e_f0961c68da04["getResolvedHostForHttpServer()"] fdaa8bba_d4f1_8642_5787_5bbf1bd2e556["util.ts"] 63a88fb0_88b4_3109_0f7e_f0961c68da04 -->|defined in| fdaa8bba_d4f1_8642_5787_5bbf1bd2e556 style 63a88fb0_88b4_3109_0f7e_f0961c68da04 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/core/preview/util.ts lines 1–11
export function getResolvedHostForHttpServer(host: string | boolean) {
if (host === false) {
// Use a secure default
return 'localhost';
} else if (host === true) {
// If passed --host in the CLI without arguments
return undefined; // undefined typically means 0.0.0.0 or :: (listen on all IPs)
} else {
return host;
}
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does getResolvedHostForHttpServer() do?
getResolvedHostForHttpServer() is a function in the astro codebase, defined in packages/astro/src/core/preview/util.ts.
Where is getResolvedHostForHttpServer() defined?
getResolvedHostForHttpServer() is defined in packages/astro/src/core/preview/util.ts at line 1.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free