Skip to content

Commit

Permalink
Merge pull request #12 from HarperDB/switch-port-to-9926
Browse files Browse the repository at this point in the history
switch from port 3000 to 9926
  • Loading branch information
kriszyp authored Dec 3, 2024
2 parents b9b658f + 3c1cc3d commit 7d3ed86
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
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

0 comments on commit 7d3ed86

Please sign in to comment.