Home / Function/ standalone() — astro Function Reference

standalone() — astro Function Reference

Architecture documentation for the standalone() function in standalone.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  9cd76d33_ae0f_8fdb_eb4a_196186334dbc["standalone()"]
  61bdb796_7444_31bb_d2a3_47bbf4268895["standalone.ts"]
  9cd76d33_ae0f_8fdb_eb4a_196186334dbc -->|defined in| 61bdb796_7444_31bb_d2a3_47bbf4268895
  f57b87c3_a702_fcde_fbce_b86d23156287["hostOptions()"]
  9cd76d33_ae0f_8fdb_eb4a_196186334dbc -->|calls| f57b87c3_a702_fcde_fbce_b86d23156287
  1387d7ff_b01e_ea25_1736_217c9f8c2698["createStandaloneHandler()"]
  9cd76d33_ae0f_8fdb_eb4a_196186334dbc -->|calls| 1387d7ff_b01e_ea25_1736_217c9f8c2698
  23e08a30_732b_c532_01f2_019dea3f5045["createServer()"]
  9cd76d33_ae0f_8fdb_eb4a_196186334dbc -->|calls| 23e08a30_732b_c532_01f2_019dea3f5045
  style 9cd76d33_ae0f_8fdb_eb4a_196186334dbc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/node/src/standalone.ts lines 20–33

export default function standalone(app: NodeApp, options: Options) {
	const port = process.env.PORT ? Number(process.env.PORT) : (options.port ?? 8080);
	const host = process.env.HOST ?? hostOptions(options.host);
	const handler = createStandaloneHandler(app, options);
	const server = createServer(handler, host, port);
	server.server.listen(port, host);
	if (process.env.ASTRO_NODE_LOGGING !== 'disabled') {
		logListeningOn(app.getAdapterLogger(), server.server, host);
	}
	return {
		server,
		done: server.closed(),
	};
}

Domain

Subdomains

Frequently Asked Questions

What does standalone() do?
standalone() is a function in the astro codebase, defined in packages/integrations/node/src/standalone.ts.
Where is standalone() defined?
standalone() is defined in packages/integrations/node/src/standalone.ts at line 20.
What does standalone() call?
standalone() calls 3 function(s): createServer, createStandaloneHandler, hostOptions.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free