diff options
author | 2022-11-17 16:48:20 +0100 | |
---|---|---|
committer | 2022-11-17 10:48:20 -0500 | |
commit | 785ea16e64218e80d1b1761b2899fbc2d7e6dd5a (patch) | |
tree | 59b644a7561f7a9f8dd454f50e9ca4986fbfa79b /packages/integrations/node/src | |
parent | 5ff546580650c78977e7344f8c20c837210dad8b (diff) | |
download | astro-785ea16e64218e80d1b1761b2899fbc2d7e6dd5a.tar.gz astro-785ea16e64218e80d1b1761b2899fbc2d7e6dd5a.tar.zst astro-785ea16e64218e80d1b1761b2899fbc2d7e6dd5a.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, |