diff options
author | 2022-11-17 16:48:20 +0100 | |
---|---|---|
committer | 2022-11-17 10:48:20 -0500 | |
commit | 12236dbc06e1e43618b61d180020a67cb31499f8 (patch) | |
tree | fd50411be961139665a2c48f07f13b7913b52e0c /packages/integrations/node/src | |
parent | ff35b4759bd0fecfee6c99bf510c2e32d2574992 (diff) | |
download | astro-12236dbc06e1e43618b61d180020a67cb31499f8.tar.gz astro-12236dbc06e1e43618b61d180020a67cb31499f8.tar.zst astro-12236dbc06e1e43618b61d180020a67cb31499f8.zip |
feat: provide HOST env variable at runtime (#5421)
* feat: provide HOST env variable at runtime
* doc: add change to documentation
* Update documentation according to suggestions
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
* fix: empty string is considered as undefined
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Diffstat (limited to 'packages/integrations/node/src')
-rw-r--r-- | packages/integrations/node/src/standalone.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/integrations/node/src/standalone.ts b/packages/integrations/node/src/standalone.ts index 5ec2455ee..1a5ab399e 100644 --- a/packages/integrations/node/src/standalone.ts +++ b/packages/integrations/node/src/standalone.ts @@ -39,7 +39,8 @@ export default function startServer(app: NodeApp, options: Options) { const { client } = resolvePaths(options); const handler = middleware(app); - const host = getResolvedHostForHttpServer(options.host); + // Allow to provide host value at runtime + const host = getResolvedHostForHttpServer(process.env.HOST !== undefined && process.env.HOST !== '' ? process.env.HOST : options.host); const server = createServer( { client, |