Skip to content

Commit

Permalink
fix(nextjs): set localhost as hostname default
Browse files Browse the repository at this point in the history
closed #17852
  • Loading branch information
myasteiner authored and ndcunningham committed Jun 30, 2023
1 parent fced370 commit 8d1b017
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/generated/packages/next/executors/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion packages/next/src/executors/server/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/executors/server/server.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8d1b017

Please sign in to comment.