Skip to content

Commit 87de0df

Browse files
committed
feat: v4.2.4 allow user control of address printing
1 parent aa6d084 commit 87de0df

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ With your new instance of NSS you can call any of the following public methods:
283283
284284
- Send a message (`msg`) via WebSocket to the page that matches the `pageId`, or send to a page or pages that match the `pattern`.
285285
286-
### **printListeningAddresses(port, \[returnInstead = false\])**
286+
### **printListeningAddresses(\[returnInstead = false\])**
287287
288288
- Prints a message to console with all the addresses the server is available at. If you want full control of the printing you can set `returnInstead` to `true`.
289289

bin/nss.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class NodeSimpleServer {
4444
map: {}
4545
};
4646

47-
#VERSION = '4.2.3';
47+
#VERSION = '4.2.4';
4848

4949
#watching = [];
5050

@@ -377,16 +377,16 @@ class NodeSimpleServer {
377377
* Print the addresses the server is listening on to the console; this is useful for users who
378378
* are not sure what address to use to access the server.
379379
*
380-
* @param {int} port The port number being listened on.
381380
* @param {boolean} [returnInstead=false] If true the function will return the message string instead.
382381
*/
383382
// eslint-disable-next-line consistent-return
384-
printListeningAddresses(port, returnInstead = false) {
383+
printListeningAddresses(returnInstead = false) {
385384
let message = 'Node Simple Server live @:\n';
386-
const addresses = this.getAddresses(port);
385+
const addresses = this.getAddresses(this.#OPS.port);
387386
addresses.forEach((address) => {
388-
message += ` ${address}`;
387+
message += ` ${address}\n`;
389388
});
389+
message += '\n';
390390

391391
if (returnInstead) {
392392
return message;

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@caboodle-tech/node-simple-server",
3-
"version": "4.2.3",
3+
"version": "4.2.4",
44
"description": "Node Simple Server (NSS): A small but effective node based server for development sites, customizable live reloading, and websocket support built-in.",
55
"main": "bin/nss.js",
66
"scripts": {

0 commit comments

Comments
 (0)