From 7b1ff09af456ea083976fb593fa591ebd051beb7 Mon Sep 17 00:00:00 2001 From: Corey Butler Date: Mon, 31 Jan 2022 12:02:29 -0600 Subject: [PATCH] Update constants.js Add support for hostname/interfaces in Deno. --- src/lib/constants.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib/constants.js b/src/lib/constants.js index ef5963f..c96c386 100644 --- a/src/lib/constants.js +++ b/src/lib/constants.js @@ -84,6 +84,15 @@ if (NGN.runtime === 'node') { } } })() +} else if (NGN.runtime === 'deno') { + if (Deno?.hostname) { + HOSTNAME = Deno.hostname() + } + if (Deno?.networkInterfaces) { + for (const {address} of Deno.networkInterfaces()) { + interfaces.add(address) + } + } } export { HOSTNAME }