diff --git a/.eslintignore b/.eslintignore index 7e298e2c8..af0a6c8bc 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1176,6 +1176,9 @@ packages/lib/models/utils/paginationToSql.js.map packages/lib/models/utils/types.d.ts packages/lib/models/utils/types.js packages/lib/models/utils/types.js.map +packages/lib/net-utils.d.ts +packages/lib/net-utils.js +packages/lib/net-utils.js.map packages/lib/ntp.d.ts packages/lib/ntp.js packages/lib/ntp.js.map diff --git a/.gitignore b/.gitignore index 25f7354ce..5e4f054e9 100644 --- a/.gitignore +++ b/.gitignore @@ -1159,6 +1159,9 @@ packages/lib/models/utils/paginationToSql.js.map packages/lib/models/utils/types.d.ts packages/lib/models/utils/types.js packages/lib/models/utils/types.js.map +packages/lib/net-utils.d.ts +packages/lib/net-utils.js +packages/lib/net-utils.js.map packages/lib/ntp.d.ts packages/lib/ntp.js packages/lib/ntp.js.map diff --git a/packages/app-cli/app/ResourceServer.js b/packages/app-cli/app/ResourceServer.js index 90eb7ad11..ac6e2ed19 100644 --- a/packages/app-cli/app/ResourceServer.js +++ b/packages/app-cli/app/ResourceServer.js @@ -1,5 +1,5 @@ const Logger = require('@joplin/lib/Logger').default; -const { netUtils } = require('@joplin/lib/net-utils.js'); +const { findAvailablePort } = require('@joplin/lib/net-utils'); const http = require('http'); const urlParser = require('url'); @@ -36,7 +36,7 @@ class ResourceServer { } async start() { - this.port_ = await netUtils.findAvailablePort([9167, 9267, 8167, 8267]); + this.port_ = await findAvailablePort([9167, 9267, 8167, 8267]); if (!this.port_) { this.logger().error('Could not find available port to start resource server. Please report the error at https://github.com/laurent22/joplin'); return; diff --git a/packages/lib/JoplinServerApi.ts b/packages/lib/JoplinServerApi.ts index 18a5f7974..05cc50568 100644 --- a/packages/lib/JoplinServerApi.ts +++ b/packages/lib/JoplinServerApi.ts @@ -5,6 +5,7 @@ import JoplinError from './JoplinError'; import { Env } from './models/Setting'; import Logger from './Logger'; import personalizedUserContentBaseUrl from './services/joplinServer/personalizedUserContentBaseUrl'; +import { getHttpStatusMessage } from './net-utils'; const { stringify } = require('query-string'); const logger = Logger.create('JoplinServerApi'); @@ -245,7 +246,7 @@ export default class JoplinServerApi { //