From 25d7027eebb136364b754a6bd2d8e6efe23efcf2 Mon Sep 17 00:00:00 2001 From: Ethan Arrowood Date: Tue, 3 Dec 2024 09:21:07 -0700 Subject: [PATCH 1/2] switch from port 3000 to 9926 --- README.md | 2 +- extension.js | 4 ++-- fixtures/next-13/config.yaml | 1 - fixtures/next-14/config.yaml | 1 - fixtures/next-15/config.yaml | 1 - 5 files changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c9d1870..84578e9 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ Specify an install command. Defaults to `npm install`. ### `port: number` -Specify a port for the Next.js server. Defaults to `3000`. +Specify a port for the Next.js server. Defaults to `9926`. ### `prebuilt: boolean` diff --git a/extension.js b/extension.js index 696ee8a..5d85482 100644 --- a/extension.js +++ b/extension.js @@ -15,7 +15,7 @@ const { NextCache } = databases.cache; * @property {string=} buildOnly - Build the Next.js app and exit. Defaults to `false`. * @property {boolean=} dev - Enable dev mode. Defaults to `false`. * @property {string=} installCommand - A custom install command. Defaults to `npm install`. - * @property {number=} port - A port for the Next.js server. Defaults to `3000`. + * @property {number=} port - A port for the Next.js server. Defaults to `9926`. * @property {boolean=} prebuilt - Instruct the extension to skip executing the `buildCommand`. Defaults to `false`. * @property {string=} subPath - A sub path for serving request from. Defaults to `''`. */ @@ -77,7 +77,7 @@ function resolveConfig(options) { buildOnly: options.buildOnly ?? false, dev: options.dev ?? false, installCommand: options.installCommand ?? 'npm install', - port: options.port ?? 3000, + port: options.port ?? 9926, prebuilt: options.prebuilt ?? false, subPath: options.subPath ?? '', cache: options.cache ?? false, diff --git a/fixtures/next-13/config.yaml b/fixtures/next-13/config.yaml index 9cc50d3..c0f2cb6 100644 --- a/fixtures/next-13/config.yaml +++ b/fixtures/next-13/config.yaml @@ -1,4 +1,3 @@ '@harperdb/nextjs': package: '@harperdb/nextjs' files: '/*' - port: 9926 diff --git a/fixtures/next-14/config.yaml b/fixtures/next-14/config.yaml index 9cc50d3..c0f2cb6 100644 --- a/fixtures/next-14/config.yaml +++ b/fixtures/next-14/config.yaml @@ -1,4 +1,3 @@ '@harperdb/nextjs': package: '@harperdb/nextjs' files: '/*' - port: 9926 diff --git a/fixtures/next-15/config.yaml b/fixtures/next-15/config.yaml index 9cc50d3..c0f2cb6 100644 --- a/fixtures/next-15/config.yaml +++ b/fixtures/next-15/config.yaml @@ -1,4 +1,3 @@ '@harperdb/nextjs': package: '@harperdb/nextjs' files: '/*' - port: 9926 From a7426955fdc0e90ecf552d9787097dc725968c64 Mon Sep 17 00:00:00 2001 From: Ethan Arrowood Date: Tue, 3 Dec 2024 12:48:35 -0700 Subject: [PATCH 2/2] . --- extension.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/extension.js b/extension.js index 5d85482..469f385 100644 --- a/extension.js +++ b/extension.js @@ -15,7 +15,8 @@ const { NextCache } = databases.cache; * @property {string=} buildOnly - Build the Next.js app and exit. Defaults to `false`. * @property {boolean=} dev - Enable dev mode. Defaults to `false`. * @property {string=} installCommand - A custom install command. Defaults to `npm install`. - * @property {number=} port - A port for the Next.js server. Defaults to `9926`. + * @property {number=} port - A port for the Next.js server. Defaults to the HarperDB HTTP Port. + * @property {number=} securePort - A (secure) port for the https Next.js server. Defaults to the HarperDB HTTPS Secure Port. * @property {boolean=} prebuilt - Instruct the extension to skip executing the `buildCommand`. Defaults to `false`. * @property {string=} subPath - A sub path for serving request from. Defaults to `''`. */ @@ -61,6 +62,7 @@ function resolveConfig(options) { assertType('dev', options.dev, 'boolean'); assertType('installCommand', options.installCommand, 'string'); assertType('port', options.port, 'number'); + assertType('securePort', options.securePort, 'number'); assertType('prebuilt', options.prebuilt, 'boolean'); assertType('subPath', options.subPath, 'string'); @@ -77,7 +79,8 @@ function resolveConfig(options) { buildOnly: options.buildOnly ?? false, dev: options.dev ?? false, installCommand: options.installCommand ?? 'npm install', - port: options.port ?? 9926, + port: options.port, + securePort: options.securePort, prebuilt: options.prebuilt ?? false, subPath: options.subPath ?? '', cache: options.cache ?? false, @@ -324,7 +327,7 @@ export function start(options = {}) { return handler(request._nodeResponse); } }, - { port: config.port } + { port: config.port, securePort: config.securePort } ); if (config.dev) {