From 33eb88566421ce8a4d9981cbddbb95421a6d3fda Mon Sep 17 00:00:00 2001 From: Liran Cohen Date: Mon, 4 Mar 2024 18:57:01 -0500 Subject: [PATCH 1/9] enhance info endpoint --- src/http-api.ts | 15 ++++++++++++--- src/json-rpc-handlers/dwn/process-message.ts | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/http-api.ts b/src/http-api.ts index 19b4680..7faf54e 100644 --- a/src/http-api.ts +++ b/src/http-api.ts @@ -21,7 +21,16 @@ import { jsonRpcRouter } from './json-rpc-api.js'; import { requestCounter, responseHistogram } from './metrics.js'; import type { RegistrationManager } from './registration/registration-manager.js'; -const packageJson = process.env.npm_package_json ? JSON.parse(readFileSync(process.env.npm_package_json).toString()) : {}; +const packageJson = process.env.npm_package_json ? JSON.parse(readFileSync(process.env.npm_package_json).toString()) : { + dependencies: {} +}; + +// when this server runs as a docker container, it is not run using the `npm` package, so `npm_package_json` env does not exist. +// we inject the versions using the respective environment variables. +const packageVersions = { + version : packageJson.version || process.env.DWN_VERSION, + sdkVersion : packageJson.dependencies['@tbd54566975/dwn-sdk-js'] || process.env.DWN_SDK_VERSION +} export class HttpApi { #config: DwnServerConfig; @@ -188,8 +197,8 @@ export class HttpApi { server : process.env.npm_package_name, maxFileSize : config.maxRecordDataSize, registrationRequirements : registrationRequirements, - version : packageJson.version, - sdkVersion : packageJson.dependencies['@tbd54566975/dwn-sdk-js'], + version : packageVersions.version, + sdkVersion : packageVersions.sdkVersion, webSocketSupport : config.webSocketSupport, }); }); diff --git a/src/json-rpc-handlers/dwn/process-message.ts b/src/json-rpc-handlers/dwn/process-message.ts index bed6db3..cac2090 100644 --- a/src/json-rpc-handlers/dwn/process-message.ts +++ b/src/json-rpc-handlers/dwn/process-message.ts @@ -115,7 +115,7 @@ export const handleDwnProcessMessage: JsonRpcHandler = async ( ); // log the unhandled error response - log.error('handleDwnProcessMessage error', jsonRpcResponse, e); + log.error('handleDwnProcessMessage error', jsonRpcResponse, dwnRequest, e); return { jsonRpcResponse } as HandlerResponse; } }; From 899dbd9774033acae6c322fe7ebb02194deb1862 Mon Sep 17 00:00:00 2001 From: Liran Cohen Date: Mon, 4 Mar 2024 19:03:44 -0500 Subject: [PATCH 2/9] better environment variable --- src/http-api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http-api.ts b/src/http-api.ts index 7faf54e..31015e6 100644 --- a/src/http-api.ts +++ b/src/http-api.ts @@ -28,7 +28,7 @@ const packageJson = process.env.npm_package_json ? JSON.parse(readFileSync(proce // when this server runs as a docker container, it is not run using the `npm` package, so `npm_package_json` env does not exist. // we inject the versions using the respective environment variables. const packageVersions = { - version : packageJson.version || process.env.DWN_VERSION, + version : packageJson.version || process.env.DWN_SERVER_VERSION, sdkVersion : packageJson.dependencies['@tbd54566975/dwn-sdk-js'] || process.env.DWN_SDK_VERSION } From a56068e82a3e922f7b705b9ed7ecaeab60237d72 Mon Sep 17 00:00:00 2001 From: Liran Cohen Date: Tue, 5 Mar 2024 07:56:49 -0500 Subject: [PATCH 3/9] read versions from package json path in docker server --- src/http-api.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/http-api.ts b/src/http-api.ts index 31015e6..f2ad805 100644 --- a/src/http-api.ts +++ b/src/http-api.ts @@ -21,15 +21,17 @@ import { jsonRpcRouter } from './json-rpc-api.js'; import { requestCounter, responseHistogram } from './metrics.js'; import type { RegistrationManager } from './registration/registration-manager.js'; -const packageJson = process.env.npm_package_json ? JSON.parse(readFileSync(process.env.npm_package_json).toString()) : { - dependencies: {} -}; - -// when this server runs as a docker container, it is not run using the `npm` package, so `npm_package_json` env does not exist. -// we inject the versions using the respective environment variables. -const packageVersions = { - version : packageJson.version || process.env.DWN_SERVER_VERSION, - sdkVersion : packageJson.dependencies['@tbd54566975/dwn-sdk-js'] || process.env.DWN_SDK_VERSION +const packageVersions: { version?: string, sdkVersion?: string } = {}; +// Server and SDK versions are pulled from `package.json` at runtime. +// If running using `npm` the `process.env.npm_package_json` variable exists. +// Otherwise within the docker server image it is located in `/dwn-server/package.json` +try { + const packageJsonFile = process.env.npm_package_json ? process.env.npm_package_json : '/dwn-server/package.json'; + const packageJson = JSON.parse(readFileSync(packageJsonFile).toString()); + packageVersions.version = packageJson.version; + packageVersions.sdkVersion = packageJson.dependencies ? packageJson.dependencies['@tbd54566975/dwn-sdk-js'] : undefined; +} catch (error: any) { + log.error('could not read package.json for version info', error); } export class HttpApi { From 53c44ac39b67746cc1717caf6439fb7a563e72e5 Mon Sep 17 00:00:00 2001 From: Liran Cohen Date: Tue, 5 Mar 2024 10:00:01 -0500 Subject: [PATCH 4/9] add more optionality to the info endpoint --- README.md | 5 +++-- src/http-api.ts | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b5b50e1..832ae18 100644 --- a/README.md +++ b/README.md @@ -321,6 +321,7 @@ the server exposes information about itself via the `/info` endpoint, which retu "maxFileSize": 1073741824, "registrationRequirements": ["proof-of-work-sha256-v0", "terms-of-service"], "version": "0.1.5", - "sdkVersion": "0.2.6" + "sdkVersion": "0.2.6", + "webSocketSupport": "true" } -``` +``` \ No newline at end of file diff --git a/src/http-api.ts b/src/http-api.ts index f2ad805..13896da 100644 --- a/src/http-api.ts +++ b/src/http-api.ts @@ -21,17 +21,25 @@ import { jsonRpcRouter } from './json-rpc-api.js'; import { requestCounter, responseHistogram } from './metrics.js'; import type { RegistrationManager } from './registration/registration-manager.js'; -const packageVersions: { version?: string, sdkVersion?: string } = {}; + +const packageVersions: { version?: string, sdkVersion?: string, server: string } = { + server: process.env.npm_package_name || process.env.DWN_SERVER_PACKAGE_NAME || '@web5/dwn-server', +}; + // Server and SDK versions are pulled from `package.json` at runtime. -// If running using `npm` the `process.env.npm_package_json` variable exists. -// Otherwise within the docker server image it is located in `/dwn-server/package.json` +// If running using `npm` the `process.env.npm_package_json` variable exists as the filepath, so we use that. +// Otherwise we check to see if a specific `DWN_SERVER_PACKAGE_JSON` exists, if it does we use that. +// Finally if both of those options don't exist we resort to the path within the docker server image, located at `/dwn-server/package.json` try { - const packageJsonFile = process.env.npm_package_json ? process.env.npm_package_json : '/dwn-server/package.json'; + const packageJsonFile = process.env.npm_package_json ? process.env.npm_package_json : + process.env.DWN_SERVER_PACKAGE_JSON ? process.env.DWN_SERVER_PACKAGE_JSON : + '/dwn-server/package.json'; + const packageJson = JSON.parse(readFileSync(packageJsonFile).toString()); packageVersions.version = packageJson.version; packageVersions.sdkVersion = packageJson.dependencies ? packageJson.dependencies['@tbd54566975/dwn-sdk-js'] : undefined; } catch (error: any) { - log.error('could not read package.json for version info', error); + log.error('could not read `package.json` for version info', error); } export class HttpApi { @@ -196,7 +204,7 @@ export class HttpApi { } res.json({ - server : process.env.npm_package_name, + server : packageVersions.server, maxFileSize : config.maxRecordDataSize, registrationRequirements : registrationRequirements, version : packageVersions.version, From 06a915c96d2a4a5794dd113df9a3387cd03a7986 Mon Sep 17 00:00:00 2001 From: Liran Cohen Date: Tue, 5 Mar 2024 10:01:19 -0500 Subject: [PATCH 5/9] bump dwn-server version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd5ee4a..3ec8af0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@web5/dwn-server", - "version": "0.1.12", + "version": "0.1.13", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@web5/dwn-server", - "version": "0.1.12", + "version": "0.1.13", "dependencies": { "@tbd54566975/dwn-sdk-js": "0.2.18", "@tbd54566975/dwn-sql-store": "0.2.10", diff --git a/package.json b/package.json index 20bad08..7025a03 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@web5/dwn-server", "type": "module", - "version": "0.1.12", + "version": "0.1.13", "files": [ "dist", "src" From d78eba31808fac7215dc5491cc9d7487a8c143bf Mon Sep 17 00:00:00 2001 From: Liran Cohen Date: Tue, 5 Mar 2024 10:02:46 -0500 Subject: [PATCH 6/9] add empty line at the end of the readme markdown file --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 832ae18..cf5eca0 100644 --- a/README.md +++ b/README.md @@ -324,4 +324,7 @@ the server exposes information about itself via the `/info` endpoint, which retu "sdkVersion": "0.2.6", "webSocketSupport": "true" } -``` \ No newline at end of file +``` + +- `server` is read from the `process.env.npm_package_name` variable that `npm` provides. If that does not exist, it will check for a `DWN_SERVER_PACKAGE_NAME` environment variable set by the user, or otherwise it will default to `@web5/dwn-server`. +- `version` and `sdkVersion` are read from the `package.json` file. It will locate the file's path either from the `process.env.npm_package_json` variable that `npm` provides. If that does not exist, it will check for a `DWN_SERVER_PACKAGE_JSON` environment variable set by the user, or otherwise it will default to `/dwn-server/package.json` which is the path within the default Docker container build. From 1da1676c5e5057027ab0a8558de1a8cf4d911258 Mon Sep 17 00:00:00 2001 From: Liran Cohen Date: Tue, 5 Mar 2024 10:30:04 -0500 Subject: [PATCH 7/9] add some coverage, move to config and constructor for http api --- src/config.ts | 2 ++ src/http-api.ts | 43 +++++++++++++++++------------------- tests/http-api.spec.ts | 50 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 23 deletions(-) diff --git a/src/config.ts b/src/config.ts index 4d9c3f1..38af20c 100644 --- a/src/config.ts +++ b/src/config.ts @@ -3,6 +3,8 @@ import bytes from 'bytes'; export type DwnServerConfig = typeof config; export const config = { + serverName: process.env.DWN_SERVER_PACKAGE_NAME || '@web5/dwn-server', + packageJsonFile: process.env.npm_package_json || process.env.DWN_SERVER_PACKAGE_JSON || '/dwn-server/package.json', // max size of data that can be provided with a RecordsWrite maxRecordDataSize: bytes(process.env.MAX_RECORD_DATA_SIZE || '1gb'), // port that server listens on diff --git a/src/http-api.ts b/src/http-api.ts index 13896da..89b723e 100644 --- a/src/http-api.ts +++ b/src/http-api.ts @@ -22,28 +22,9 @@ import { requestCounter, responseHistogram } from './metrics.js'; import type { RegistrationManager } from './registration/registration-manager.js'; -const packageVersions: { version?: string, sdkVersion?: string, server: string } = { - server: process.env.npm_package_name || process.env.DWN_SERVER_PACKAGE_NAME || '@web5/dwn-server', -}; - -// Server and SDK versions are pulled from `package.json` at runtime. -// If running using `npm` the `process.env.npm_package_json` variable exists as the filepath, so we use that. -// Otherwise we check to see if a specific `DWN_SERVER_PACKAGE_JSON` exists, if it does we use that. -// Finally if both of those options don't exist we resort to the path within the docker server image, located at `/dwn-server/package.json` -try { - const packageJsonFile = process.env.npm_package_json ? process.env.npm_package_json : - process.env.DWN_SERVER_PACKAGE_JSON ? process.env.DWN_SERVER_PACKAGE_JSON : - '/dwn-server/package.json'; - - const packageJson = JSON.parse(readFileSync(packageJsonFile).toString()); - packageVersions.version = packageJson.version; - packageVersions.sdkVersion = packageJson.dependencies ? packageJson.dependencies['@tbd54566975/dwn-sdk-js'] : undefined; -} catch (error: any) { - log.error('could not read `package.json` for version info', error); -} - export class HttpApi { #config: DwnServerConfig; + #packageInfo: { version?: string, sdkVersion?: string, server: string }; #api: Express; #server: http.Server; registrationManager: RegistrationManager; @@ -52,6 +33,22 @@ export class HttpApi { constructor(config: DwnServerConfig, dwn: Dwn, registrationManager?: RegistrationManager) { console.log(config); + this.#packageInfo = { + server: config.serverName, + }; + + // Server and SDK versions are pulled from `package.json` at runtime. + // If running using `npm` the `process.env.npm_package_json` variable exists as the filepath, so we use that. + // Otherwise we check to see if a specific `DWN_SERVER_PACKAGE_JSON` exists, if it does we use that. + // Finally if both of those options don't exist we resort to the path within the docker server image, located at `/dwn-server/package.json` + try { + const packageJson = JSON.parse(readFileSync(config.packageJsonFile).toString()); + this.#packageInfo.version = packageJson.version; + this.#packageInfo.sdkVersion = packageJson.dependencies ? packageJson.dependencies['@tbd54566975/dwn-sdk-js'] : undefined; + } catch (error: any) { + log.error('could not read `package.json` for version info', error); + } + this.#config = config; this.#api = express(); this.#server = http.createServer(this.#api); @@ -204,11 +201,11 @@ export class HttpApi { } res.json({ - server : packageVersions.server, + server : this.#packageInfo.server, maxFileSize : config.maxRecordDataSize, registrationRequirements : registrationRequirements, - version : packageVersions.version, - sdkVersion : packageVersions.sdkVersion, + version : this.#packageInfo.version, + sdkVersion : this.#packageInfo.sdkVersion, webSocketSupport : config.webSocketSupport, }); }); diff --git a/tests/http-api.spec.ts b/tests/http-api.spec.ts index 621660d..f611a8d 100644 --- a/tests/http-api.spec.ts +++ b/tests/http-api.spec.ts @@ -1,4 +1,5 @@ // node.js 18 and earlier, needs globalThis.crypto polyfill +import sinon from 'sinon'; import { Cid, DataStream, @@ -18,6 +19,7 @@ import request from 'supertest'; import { v4 as uuidv4 } from 'uuid'; import { config } from '../src/config.js'; +import log from 'loglevel'; import { HttpApi } from '../src/http-api.js'; import type { JsonRpcErrorResponse, @@ -71,6 +73,7 @@ describe('http api', function () { }); beforeEach(async function () { + sinon.restore(); server = await httpApi.start(3000); }); @@ -80,6 +83,7 @@ describe('http api', function () { }); after(function () { + sinon.restore(); clock.restore(); }); @@ -561,6 +565,52 @@ describe('http api', function () { info = await resp.json(); expect(info['server']).to.equal('@web5/dwn-server'); expect(info['webSocketSupport']).to.equal(false); + + // restore old config value + config.webSocketSupport = true; + }); + + it('verify /info still returns when package.json file does not exist', async function () { + server.close(); + server.closeAllConnections(); + + const logSpy = sinon.spy(log, 'error'); + + const packageJsonConfig = config.packageJsonFile; + config.packageJsonFile = '/some/invalid/file.json'; + httpApi = new HttpApi(config, dwn, registrationManager); + server = await httpApi.start(3000); + + const resp = await fetch(`http://localhost:3000/info`); + const info = await resp.json(); + expect(resp.status).to.equal(200); + expect(info['server']).to.equal('@web5/dwn-server'); + expect(info['sdkVersion']).to.be.undefined; + expect(info['version']).to.be.undefined; + expect(logSpy.callCount).to.equal(1); + + // restore old config path + config.packageJsonFile = packageJsonConfig; + }); + + it('verify /info returns server name from config', async function () { + server.close(); + server.closeAllConnections(); + + const serverName = config.serverName; + config.serverName = '@web5/dwn-server-2' + httpApi = new HttpApi(config, dwn, registrationManager); + server = await httpApi.start(3000); + + const resp = await fetch(`http://localhost:3000/info`); + const info = await resp.json(); + expect(resp.status).to.equal(200); + expect(info['server']).to.equal('@web5/dwn-server-2'); + expect(info['sdkVersion']).to.not.be.undefined; + expect(info['version']).to.not.be.undefined; + + // restore server name config + config.serverName = serverName; }); }); }); From 63a3f2923162d8e54e0774b11203bbee08b1de54 Mon Sep 17 00:00:00 2001 From: Liran Cohen Date: Tue, 5 Mar 2024 10:41:31 -0500 Subject: [PATCH 8/9] comments --- src/config.ts | 2 ++ tests/http-api.spec.ts | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/config.ts b/src/config.ts index 38af20c..a68b7ae 100644 --- a/src/config.ts +++ b/src/config.ts @@ -3,7 +3,9 @@ import bytes from 'bytes'; export type DwnServerConfig = typeof config; export const config = { + // the `server` property returned by the `/info` endpoint. serverName: process.env.DWN_SERVER_PACKAGE_NAME || '@web5/dwn-server', + // used to populate the `version` and `sdkVersion` properties returned by the `/info` endpoint. packageJsonFile: process.env.npm_package_json || process.env.DWN_SERVER_PACKAGE_JSON || '/dwn-server/package.json', // max size of data that can be provided with a RecordsWrite maxRecordDataSize: bytes(process.env.MAX_RECORD_DATA_SIZE || '1gb'), diff --git a/tests/http-api.spec.ts b/tests/http-api.spec.ts index f611a8d..49748b9 100644 --- a/tests/http-api.spec.ts +++ b/tests/http-api.spec.ts @@ -574,8 +574,10 @@ describe('http api', function () { server.close(); server.closeAllConnections(); + // set up spy to check for an error log by the server const logSpy = sinon.spy(log, 'error'); + // set the config to an invalid file path const packageJsonConfig = config.packageJsonFile; config.packageJsonFile = '/some/invalid/file.json'; httpApi = new HttpApi(config, dwn, registrationManager); @@ -584,10 +586,17 @@ describe('http api', function () { const resp = await fetch(`http://localhost:3000/info`); const info = await resp.json(); expect(resp.status).to.equal(200); + + // check that server name exists in the info object expect(info['server']).to.equal('@web5/dwn-server'); + + // check that `sdkVersion` and `version` are undefined as they were not abel to be retrieved from the invalid file. expect(info['sdkVersion']).to.be.undefined; expect(info['version']).to.be.undefined; + + // check the logSpy was called expect(logSpy.callCount).to.equal(1); + expect(logSpy.args[0][0]).to.contain('could not read `package.json` for version info'); // restore old config path config.packageJsonFile = packageJsonConfig; @@ -597,6 +606,7 @@ describe('http api', function () { server.close(); server.closeAllConnections(); + // set a custom name for the `serverName` const serverName = config.serverName; config.serverName = '@web5/dwn-server-2' httpApi = new HttpApi(config, dwn, registrationManager); @@ -605,7 +615,11 @@ describe('http api', function () { const resp = await fetch(`http://localhost:3000/info`); const info = await resp.json(); expect(resp.status).to.equal(200); + + // verify that the custom server name was passed to the info endpoint expect(info['server']).to.equal('@web5/dwn-server-2'); + + // verify that `sdkVersion` and `version` exist. expect(info['sdkVersion']).to.not.be.undefined; expect(info['version']).to.not.be.undefined; From b3c811b07789292471ecc7185deb558f4dc8a817 Mon Sep 17 00:00:00 2001 From: Liran Cohen Date: Tue, 5 Mar 2024 14:50:36 -0500 Subject: [PATCH 9/9] update comments per review suggestions --- src/config.ts | 20 ++++++++++++++++---- src/http-api.ts | 7 ++----- tests/http-api.spec.ts | 6 +++--- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/config.ts b/src/config.ts index a68b7ae..ee1f895 100644 --- a/src/config.ts +++ b/src/config.ts @@ -3,10 +3,22 @@ import bytes from 'bytes'; export type DwnServerConfig = typeof config; export const config = { - // the `server` property returned by the `/info` endpoint. - serverName: process.env.DWN_SERVER_PACKAGE_NAME || '@web5/dwn-server', - // used to populate the `version` and `sdkVersion` properties returned by the `/info` endpoint. - packageJsonFile: process.env.npm_package_json || process.env.DWN_SERVER_PACKAGE_JSON || '/dwn-server/package.json', + /** + * Used to populate the `server` property returned by the `/info` endpoint. + * + * If running using `npm` the `process.env.npm_package_name` variable exists and we use that, + * otherwise we fall back on the use defined `DWN_SERVER_PACKAGE_NAME` or `@web5/dwn-server`. + */ + serverName: process.env.npm_package_name || process.env.DWN_SERVER_PACKAGE_NAME || '@web5/dwn-server', + /** + * Used to populate the `version` and `sdkVersion` properties returned by the `/info` endpoint. + * + * The `version` and `sdkVersion` are pulled from `package.json` at runtime. + * If running using `npm` the `process.env.npm_package_json` variable exists as the filepath, so we use that. + * Otherwise we check to see if a specific `DWN_SERVER_PACKAGE_JSON` exists, if it does we use that. + * Finally if both of those options don't exist we resort to the path within the docker server image, located at `/dwn-server/package.json` + */ + packageJsonPath: process.env.npm_package_json || process.env.DWN_SERVER_PACKAGE_JSON || '/dwn-server/package.json', // max size of data that can be provided with a RecordsWrite maxRecordDataSize: bytes(process.env.MAX_RECORD_DATA_SIZE || '1gb'), // port that server listens on diff --git a/src/http-api.ts b/src/http-api.ts index 89b723e..8abfa61 100644 --- a/src/http-api.ts +++ b/src/http-api.ts @@ -37,12 +37,9 @@ export class HttpApi { server: config.serverName, }; - // Server and SDK versions are pulled from `package.json` at runtime. - // If running using `npm` the `process.env.npm_package_json` variable exists as the filepath, so we use that. - // Otherwise we check to see if a specific `DWN_SERVER_PACKAGE_JSON` exists, if it does we use that. - // Finally if both of those options don't exist we resort to the path within the docker server image, located at `/dwn-server/package.json` try { - const packageJson = JSON.parse(readFileSync(config.packageJsonFile).toString()); + // We populate the `version` and `sdkVersion` properties from the `package.json` file. + const packageJson = JSON.parse(readFileSync(config.packageJsonPath).toString()); this.#packageInfo.version = packageJson.version; this.#packageInfo.sdkVersion = packageJson.dependencies ? packageJson.dependencies['@tbd54566975/dwn-sdk-js'] : undefined; } catch (error: any) { diff --git a/tests/http-api.spec.ts b/tests/http-api.spec.ts index 49748b9..eabd370 100644 --- a/tests/http-api.spec.ts +++ b/tests/http-api.spec.ts @@ -578,8 +578,8 @@ describe('http api', function () { const logSpy = sinon.spy(log, 'error'); // set the config to an invalid file path - const packageJsonConfig = config.packageJsonFile; - config.packageJsonFile = '/some/invalid/file.json'; + const packageJsonConfig = config.packageJsonPath; + config.packageJsonPath = '/some/invalid/file.json'; httpApi = new HttpApi(config, dwn, registrationManager); server = await httpApi.start(3000); @@ -599,7 +599,7 @@ describe('http api', function () { expect(logSpy.args[0][0]).to.contain('could not read `package.json` for version info'); // restore old config path - config.packageJsonFile = packageJsonConfig; + config.packageJsonPath = packageJsonConfig; }); it('verify /info returns server name from config', async function () {