From 59408e7b464099d0f9051ab8dec06e745dbd9572 Mon Sep 17 00:00:00 2001 From: Rahul Retnan <33414802+rahulretnan@users.noreply.github.com> Date: Sat, 1 Jul 2023 17:25:38 +0530 Subject: [PATCH] fix(nextjs): updated 0.0.0.0 as default hostname (#17902) --- docs/generated/packages/next/executors/server.json | 2 +- packages/next/src/executors/server/schema.json | 2 +- packages/next/src/executors/server/server.impl.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/generated/packages/next/executors/server.json b/docs/generated/packages/next/executors/server.json index 0c02522734cee..ba563825e6801 100644 --- a/docs/generated/packages/next/executors/server.json +++ b/docs/generated/packages/next/executors/server.json @@ -42,7 +42,7 @@ "hostname": { "type": "string", "description": "Hostname on which the application is served.", - "default": "localhost" + "default": "0.0.0.0" }, "buildLibsFromSource": { "type": "boolean", diff --git a/packages/next/src/executors/server/schema.json b/packages/next/src/executors/server/schema.json index da54158e3bf90..4aeb3e6f27bb2 100644 --- a/packages/next/src/executors/server/schema.json +++ b/packages/next/src/executors/server/schema.json @@ -39,7 +39,7 @@ "hostname": { "type": "string", "description": "Hostname on which the application is served.", - "default": "localhost" + "default": "0.0.0.0" }, "buildLibsFromSource": { "type": "boolean", diff --git a/packages/next/src/executors/server/server.impl.ts b/packages/next/src/executors/server/server.impl.ts index 2593420bea32d..539c81c7ed6e9 100644 --- a/packages/next/src/executors/server/server.impl.ts +++ b/packages/next/src/executors/server/server.impl.ts @@ -30,7 +30,7 @@ export default async function* serveExecutor( ); const projectRoot = context.workspace.projects[context.projectName].root; - const { port, keepAliveTimeout, hostname = 'localhost' } = options; + const { port, keepAliveTimeout, hostname = '0.0.0.0' } = options; // This is required for the default custom server to work. See the @nx/next:app generator. process.env.NX_NEXT_DIR = projectRoot;