Skip to content

Commit

Permalink
fix(nextjs): set localhost as hostname default (#17856)
Browse files Browse the repository at this point in the history
  • Loading branch information
myabeaver authored Jun 30, 2023
1 parent 4d76d0c commit 88c655f
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

1 comment on commit 88c655f

@vercel
Copy link

@vercel vercel bot commented on 88c655f Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx.dev
nx-five.vercel.app

Please sign in to comment.