From 0e1e20b81761a66d3901bdd70cf2353924785ec6 Mon Sep 17 00:00:00 2001 From: wuls Date: Tue, 23 May 2023 11:33:33 +0800 Subject: [PATCH] delect white space --- packages/integrations/node/src/standalone.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/integrations/node/src/standalone.ts b/packages/integrations/node/src/standalone.ts index d6fe0a195..ed5d04ed5 100644 --- a/packages/integrations/node/src/standalone.ts +++ b/packages/integrations/node/src/standalone.ts @@ -40,14 +40,11 @@ export default function startServer(app: NodeApp, options: Options) { const port = process.env.PORT ? Number(process.env.PORT) : options.port ?? 8080; const { client } = resolvePaths(options); const handler = middleware(app, options.mode); + // 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, @@ -57,6 +54,7 @@ export default function startServer(app: NodeApp, options: Options) { }, handler ); + const protocol = server.server instanceof https.Server ? 'https' : 'http'; const address = getNetworkAddress(protocol, host!, port)