From 8d1b01771301c0daa5faec72c7ef6e7c1f7e94d8 Mon Sep 17 00:00:00 2001 From: myasteiner Date: Thu, 29 Jun 2023 12:31:05 +0000 Subject: [PATCH] fix(nextjs): set localhost as hostname default closed #17852 --- docs/generated/packages/next/executors/server.json | 3 ++- packages/next/src/executors/server/schema.json | 3 ++- packages/next/src/executors/server/server.impl.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/generated/packages/next/executors/server.json b/docs/generated/packages/next/executors/server.json index c462e35e7c7f8..0c02522734cee 100644 --- a/docs/generated/packages/next/executors/server.json +++ b/docs/generated/packages/next/executors/server.json @@ -41,7 +41,8 @@ }, "hostname": { "type": "string", - "description": "Hostname on which the application is served." + "description": "Hostname on which the application is served.", + "default": "localhost" }, "buildLibsFromSource": { "type": "boolean", diff --git a/packages/next/src/executors/server/schema.json b/packages/next/src/executors/server/schema.json index 13f094bbab6f6..da54158e3bf90 100644 --- a/packages/next/src/executors/server/schema.json +++ b/packages/next/src/executors/server/schema.json @@ -38,7 +38,8 @@ }, "hostname": { "type": "string", - "description": "Hostname on which the application is served." + "description": "Hostname on which the application is served.", + "default": "localhost" }, "buildLibsFromSource": { "type": "boolean", diff --git a/packages/next/src/executors/server/server.impl.ts b/packages/next/src/executors/server/server.impl.ts index 78e06255ad43b..2593420bea32d 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 } = options; + const { port, keepAliveTimeout, hostname = 'localhost' } = options; // This is required for the default custom server to work. See the @nx/next:app generator. process.env.NX_NEXT_DIR = projectRoot;