diff --git a/src/server/Server.js b/src/server/Server.js index 4d7e7c5..69f3da7 100644 --- a/src/server/Server.js +++ b/src/server/Server.js @@ -2,7 +2,7 @@ const { EventEmitter } = require('node:events'); // const { inspect } = require('node:util'); const path = require('node:path'); -const http = require('node:http2'); +const http = require('node:http'); // External const { LoggerClient } = require('@navy.gif/logger'); @@ -41,8 +41,7 @@ class Server extends EventEmitter { if (!httpOpts?.port) return Util.fatal(new Error(`Missing http.port in server options`)); this.port = httpOpts.port + this._shardId; - this.domain = options.domain; - + this.domain = NODE_ENV === 'development' ? `localhost:${this.port}` : options.domain; this.server = null; this.app = express(); diff --git a/src/server/interfaces/Endpoint.js b/src/server/interfaces/Endpoint.js index 731222a..33ca5a5 100644 --- a/src/server/interfaces/Endpoint.js +++ b/src/server/interfaces/Endpoint.js @@ -15,7 +15,7 @@ class Endpoint { // Subpaths that should exist on *all* endpoints, the subpaths property can be overwritten, so storing these separately to ensure they exist this._subpaths = [ - '/debug', 'post', this.toggleDebug.bind(this), [ server.authenticator.createAuthoriser('developer') ] + [ '/debug', 'post', this.toggleDebug.bind(this), [ server.authenticator.createAuthoriser('developer') ]] ]; this.middleware = [];