localhost for domain in development

This commit is contained in:
Erik 2022-11-09 16:50:43 +02:00
parent bb272881fb
commit 3563eeaf23
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
2 changed files with 3 additions and 4 deletions

View File

@ -2,7 +2,7 @@
const { EventEmitter } = require('node:events'); const { EventEmitter } = require('node:events');
// const { inspect } = require('node:util'); // const { inspect } = require('node:util');
const path = require('node:path'); const path = require('node:path');
const http = require('node:http2'); const http = require('node:http');
// External // External
const { LoggerClient } = require('@navy.gif/logger'); 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`)); if (!httpOpts?.port) return Util.fatal(new Error(`Missing http.port in server options`));
this.port = httpOpts.port + this._shardId; this.port = httpOpts.port + this._shardId;
this.domain = options.domain; this.domain = NODE_ENV === 'development' ? `localhost:${this.port}` : options.domain;
this.server = null; this.server = null;
this.app = express(); this.app = express();

View File

@ -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 // Subpaths that should exist on *all* endpoints, the subpaths property can be overwritten, so storing these separately to ensure they exist
this._subpaths = [ this._subpaths = [
'/debug', 'post', this.toggleDebug.bind(this), [ server.authenticator.createAuthoriser('developer') ] [ '/debug', 'post', this.toggleDebug.bind(this), [ server.authenticator.createAuthoriser('developer') ]]
]; ];
this.middleware = []; this.middleware = [];