Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch from port 3000 to 9926 #12

Merged
merged 4 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
9 changes: 6 additions & 3 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import shellQuote from 'shell-quote';
* @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 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 `''`.
*/
Expand Down Expand Up @@ -59,6 +60,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');

Expand All @@ -75,7 +77,8 @@ function resolveConfig(options) {
buildOnly: options.buildOnly ?? false,
dev: options.dev ?? false,
installCommand: options.installCommand ?? 'npm install',
port: options.port ?? 3000,
port: options.port,
securePort: options.securePort,
prebuilt: options.prebuilt ?? false,
subPath: options.subPath ?? '',
cache: options.cache ?? false,
Expand Down Expand Up @@ -291,7 +294,7 @@ export function start(options = {}) {
: nodeRequest.url;
return requestHandler(nodeRequest, request._nodeResponse, url.parse(nodeRequest.url, true));
},
{ port: config.port }
{ port: config.port, securePort: config.securePort }
);

if (config.dev) {
Expand Down
1 change: 0 additions & 1 deletion fixtures/next-13/config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'@harperdb/nextjs':
package: '@harperdb/nextjs'
files: '/*'
port: 9926
1 change: 0 additions & 1 deletion fixtures/next-14/config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'@harperdb/nextjs':
package: '@harperdb/nextjs'
files: '/*'
port: 9926
1 change: 0 additions & 1 deletion fixtures/next-15/config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'@harperdb/nextjs':
package: '@harperdb/nextjs'
files: '/*'
port: 9926
Loading